diff --git a/Library/Homebrew/cmd/upgrade.rb b/Library/Homebrew/cmd/upgrade.rb index 026494d98a..f80a218eb8 100644 --- a/Library/Homebrew/cmd/upgrade.rb +++ b/Library/Homebrew/cmd/upgrade.rb @@ -63,7 +63,6 @@ module Homebrew extend self installer = FormulaInstaller.new(f) installer.tab = tab installer.show_header = false - installer.install_bottle = (install_bottle?(f) and tab.used_options.empty?) oh1 "Upgrading #{f.name}" diff --git a/Library/Homebrew/formula_installer.rb b/Library/Homebrew/formula_installer.rb index 9516af6502..769fe8475f 100644 --- a/Library/Homebrew/formula_installer.rb +++ b/Library/Homebrew/formula_installer.rb @@ -10,14 +10,13 @@ class FormulaInstaller attr :tab, true attr :show_summary_heading, true attr :ignore_deps, true - attr :install_bottle, true attr :show_header, true def initialize ff @f = ff @show_header = false @ignore_deps = ARGV.ignore_deps? || ARGV.interactive? - @install_bottle = install_bottle? ff + @options = [] @@attempted ||= Set.new @@ -25,6 +24,10 @@ class FormulaInstaller check_install_sanity end + def pour_bottle? + install_bottle?(f) && (tab.used_options.empty? rescue true) && options.empty? + end + def check_install_sanity raise FormulaInstallationAlreadyAttemptedError, f if @@attempted.include? f @@ -89,7 +92,7 @@ class FormulaInstaller @@attempted << f - if install_bottle + if pour_bottle? pour else build @@ -104,7 +107,7 @@ class FormulaInstaller f.recursive_requirements.reject(&:satisfied?) end - needed_reqs.reject!(&:build?) if install_bottle + needed_reqs.reject!(&:build?) if pour_bottle? unless needed_reqs.empty? puts needed_reqs.map(&:message) * "\n" @@ -233,7 +236,7 @@ class FormulaInstaller end def build_time - @build_time ||= Time.now - @start_time unless install_bottle or ARGV.interactive? or @start_time.nil? + @build_time ||= Time.now - @start_time unless pour_bottle? or ARGV.interactive? or @start_time.nil? end def build