From 975771ab358ca582f6d5119c63bf32792735ac60 Mon Sep 17 00:00:00 2001 From: Xu Cheng Date: Mon, 14 Sep 2015 19:59:00 +0800 Subject: [PATCH] formula_installer: let build_bottle? check bottle_disabled? Also don't pour bottle if it's disabled. --- Library/Homebrew/formula_installer.rb | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/Library/Homebrew/formula_installer.rb b/Library/Homebrew/formula_installer.rb index 0d9943a07e..4cb3b17b17 100644 --- a/Library/Homebrew/formula_installer.rb +++ b/Library/Homebrew/formula_installer.rb @@ -29,9 +29,9 @@ class FormulaInstaller end attr_reader :formula - attr_accessor :options + attr_accessor :options, :build_bottle mode_attr_accessor :show_summary_heading, :show_header - mode_attr_accessor :build_from_source, :build_bottle, :force_bottle + mode_attr_accessor :build_from_source, :force_bottle mode_attr_accessor :ignore_deps, :only_deps, :interactive, :git mode_attr_accessor :verbose, :debug, :quieter @@ -69,6 +69,10 @@ class FormulaInstaller raise BuildFlagsError.new(build_flags) unless build_flags.empty? end + def build_bottle? + !!@build_bottle && !formula.bottle_disabled? + end + def pour_bottle?(install_bottle_options = { :warn=>false }) return true if Homebrew::Hooks::Bottles.formula_has_bottle?(formula) @@ -78,6 +82,7 @@ class FormulaInstaller return true if force_bottle? && bottle return false if build_from_source? || build_bottle? || interactive? return false unless options.empty? + return false if formula.bottle_disabled? return true if formula.local_bottle_path return false unless bottle && formula.pour_bottle?