Split bottle logic.

Fixes Homebrew/homebrew#8805.
This commit is contained in:
Mike McQuaid 2012-02-09 21:05:17 +00:00
parent 469ad7bee5
commit 27ecdb4266
2 changed files with 5 additions and 2 deletions

View File

@ -57,6 +57,10 @@ class Formula
return false return false
end end
def bottle_up_to_date?
!bottle_url.nil? && Pathname.new(bottle_url).version == version
end
def explicitly_requested? def explicitly_requested?
# `ARGV.formulae` will throw an exception if it comes up with an empty list. # `ARGV.formulae` will throw an exception if it comes up with an empty list.
# FIXME: `ARGV.formulae` shouldn't be throwing exceptions, see issue #8823 # FIXME: `ARGV.formulae` shouldn't be throwing exceptions, see issue #8823

View File

@ -15,8 +15,7 @@ class FormulaInstaller
@f = ff @f = ff
@show_header = true @show_header = true
@ignore_deps = ARGV.include? '--ignore-dependencies' || ARGV.interactive? @ignore_deps = ARGV.include? '--ignore-dependencies' || ARGV.interactive?
@install_bottle = !ff.bottle_url.nil? && !ARGV.build_from_source? && @install_bottle = !ARGV.build_from_source? && ff.bottle_up_to_date?
Pathname.new(ff.bottle_url).version == ff.version
end end
def install def install