FormulaInstaller: don't install bottle if options were passed

This commit is contained in:
Jack Nagel 2013-01-23 00:26:27 -06:00
parent 5822aa80cf
commit 951872c4be
2 changed files with 8 additions and 6 deletions

View File

@ -63,7 +63,6 @@ module Homebrew extend self
installer = FormulaInstaller.new(f) installer = FormulaInstaller.new(f)
installer.tab = tab installer.tab = tab
installer.show_header = false installer.show_header = false
installer.install_bottle = (install_bottle?(f) and tab.used_options.empty?)
oh1 "Upgrading #{f.name}" oh1 "Upgrading #{f.name}"

View File

@ -10,14 +10,13 @@ class FormulaInstaller
attr :tab, true attr :tab, true
attr :show_summary_heading, true attr :show_summary_heading, true
attr :ignore_deps, true attr :ignore_deps, true
attr :install_bottle, true
attr :show_header, true attr :show_header, true
def initialize ff def initialize ff
@f = ff @f = ff
@show_header = false @show_header = false
@ignore_deps = ARGV.ignore_deps? || ARGV.interactive? @ignore_deps = ARGV.ignore_deps? || ARGV.interactive?
@install_bottle = install_bottle? ff @options = []
@@attempted ||= Set.new @@attempted ||= Set.new
@ -25,6 +24,10 @@ class FormulaInstaller
check_install_sanity check_install_sanity
end end
def pour_bottle?
install_bottle?(f) && (tab.used_options.empty? rescue true) && options.empty?
end
def check_install_sanity def check_install_sanity
raise FormulaInstallationAlreadyAttemptedError, f if @@attempted.include? f raise FormulaInstallationAlreadyAttemptedError, f if @@attempted.include? f
@ -89,7 +92,7 @@ class FormulaInstaller
@@attempted << f @@attempted << f
if install_bottle if pour_bottle?
pour pour
else else
build build
@ -104,7 +107,7 @@ class FormulaInstaller
f.recursive_requirements.reject(&:satisfied?) f.recursive_requirements.reject(&:satisfied?)
end end
needed_reqs.reject!(&:build?) if install_bottle needed_reqs.reject!(&:build?) if pour_bottle?
unless needed_reqs.empty? unless needed_reqs.empty?
puts needed_reqs.map(&:message) * "\n" puts needed_reqs.map(&:message) * "\n"
@ -233,7 +236,7 @@ class FormulaInstaller
end end
def build_time 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 end
def build def build