From 27ecdb4266a6edf106f9b9f4a8fb80241fcc8e8a Mon Sep 17 00:00:00 2001 From: Mike McQuaid Date: Thu, 9 Feb 2012 21:05:17 +0000 Subject: [PATCH] Split bottle logic. Fixes Homebrew/homebrew#8805. --- Library/Homebrew/formula.rb | 4 ++++ Library/Homebrew/formula_installer.rb | 3 +-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/Library/Homebrew/formula.rb b/Library/Homebrew/formula.rb index d53316fa72..28592eb725 100644 --- a/Library/Homebrew/formula.rb +++ b/Library/Homebrew/formula.rb @@ -57,6 +57,10 @@ class Formula return false end + def bottle_up_to_date? + !bottle_url.nil? && Pathname.new(bottle_url).version == version + end + def explicitly_requested? # `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 diff --git a/Library/Homebrew/formula_installer.rb b/Library/Homebrew/formula_installer.rb index c5f0f999e5..9e52b9e3b7 100644 --- a/Library/Homebrew/formula_installer.rb +++ b/Library/Homebrew/formula_installer.rb @@ -15,8 +15,7 @@ class FormulaInstaller @f = ff @show_header = true @ignore_deps = ARGV.include? '--ignore-dependencies' || ARGV.interactive? - @install_bottle = !ff.bottle_url.nil? && !ARGV.build_from_source? && - Pathname.new(ff.bottle_url).version == ff.version + @install_bottle = !ARGV.build_from_source? && ff.bottle_up_to_date? end def install