From 8f3579302017a90e4cafe911fcd0de122005e55c Mon Sep 17 00:00:00 2001 From: Mike McQuaid Date: Fri, 1 Mar 2013 17:44:58 +0000 Subject: [PATCH] Support 32-bit 10.6 bottles. Closes Homebrew/homebrew#17735. Signed-off-by: Mike McQuaid --- Library/Homebrew/bottles.rb | 1 - Library/Homebrew/cmd/info.rb | 2 +- Library/Homebrew/extend/ARGV.rb | 2 +- Library/Homebrew/formula.rb | 2 +- Library/Homebrew/macos.rb | 13 ++------- Library/Homebrew/test/test_bottles.rb | 38 +++++++++------------------ 6 files changed, 17 insertions(+), 41 deletions(-) diff --git a/Library/Homebrew/bottles.rb b/Library/Homebrew/bottles.rb index 07eb2c5f3c..a11350fed4 100644 --- a/Library/Homebrew/bottles.rb +++ b/Library/Homebrew/bottles.rb @@ -14,7 +14,6 @@ def install_bottle? f and f.downloader.local_bottle_path return false if ARGV.build_from_source? - return false unless MacOS.bottles_supported? return false unless f.pour_bottle? return false unless f.build.used_options.empty? return false unless bottle_current?(f) diff --git a/Library/Homebrew/cmd/info.rb b/Library/Homebrew/cmd/info.rb index b0ef8560e8..655cbdeea8 100644 --- a/Library/Homebrew/cmd/info.rb +++ b/Library/Homebrew/cmd/info.rb @@ -74,7 +74,7 @@ module Homebrew extend self def info_formula f specs = [] stable = "stable #{f.stable.version}" if f.stable - stable += " (bottled)" if f.bottle and MacOS.bottles_supported? + stable += " (bottled)" if f.bottle specs << stable if stable specs << "devel #{f.devel.version}" if f.devel specs << "HEAD" if f.head diff --git a/Library/Homebrew/extend/ARGV.rb b/Library/Homebrew/extend/ARGV.rb index 5f9b992a85..047a5d8fd6 100644 --- a/Library/Homebrew/extend/ARGV.rb +++ b/Library/Homebrew/extend/ARGV.rb @@ -126,7 +126,7 @@ module HomebrewArgvExtension end def build_bottle? - include? '--build-bottle' and MacOS.bottles_supported?(true) + include? '--build-bottle' end def build_from_source? diff --git a/Library/Homebrew/formula.rb b/Library/Homebrew/formula.rb index d1ef58f50e..0a1847fa5f 100644 --- a/Library/Homebrew/formula.rb +++ b/Library/Homebrew/formula.rb @@ -478,7 +478,7 @@ class Formula "homepage" => homepage, "versions" => { "stable" => (stable.version.to_s if stable), - "bottle" => bottle && MacOS.bottles_supported? || false, + "bottle" => bottle || false, "devel" => (devel.version.to_s if devel), "head" => (head.version.to_s if head) }, diff --git a/Library/Homebrew/macos.rb b/Library/Homebrew/macos.rb index bc886ce4b7..dae0a1126a 100644 --- a/Library/Homebrew/macos.rb +++ b/Library/Homebrew/macos.rb @@ -11,7 +11,8 @@ module MacOS extend self def cat if version == :mountain_lion then :mountain_lion elsif version == :lion then :lion - elsif version == :snow_leopard then :snow_leopard + elsif version == :snow_leopard + Hardware.is_64_bit? ? :snow_leopard : :snow_leopard_32 elsif version == :leopard then :leopard else nil end @@ -234,16 +235,6 @@ module MacOS extend self def pkgutil_info id `/usr/sbin/pkgutil --pkg-info "#{id}" 2>/dev/null`.strip end - - def bottles_supported? raise_if_failed=false - # We support bottles on all versions of OS X except 32-bit Snow Leopard. - if Hardware.is_32_bit? and MacOS.version == :snow_leopard - return false unless raise_if_failed - raise "Bottles are not supported on 32-bit Snow Leopard." - end - - true - end end require 'macos/xcode' diff --git a/Library/Homebrew/test/test_bottles.rb b/Library/Homebrew/test/test_bottles.rb index 19d502b729..5c18cc6819 100644 --- a/Library/Homebrew/test/test_bottles.rb +++ b/Library/Homebrew/test/test_bottles.rb @@ -1,36 +1,22 @@ require 'testing_env' require 'test/testball' -# We temporarily redefine bottles_supported? because the -# following tests assume it is true, but other tests may -# expect the real value. -module MacOS extend self - def bottles_are_supported - alias :old_bottles_supported? :bottles_supported? - def bottles_supported?; true end - yield - def bottles_supported?; old_bottles_supported? end - end -end - class BottleTests < Test::Unit::TestCase def test_bottle_spec_selection - MacOS.bottles_are_supported do - f = SnowLeopardBottleSpecTestBall.new + f = SnowLeopardBottleSpecTestBall.new - assert_equal case MacOS.cat - when :snow_leopard then f.bottle - else f.stable - end, f.active_spec + assert_equal case MacOS.cat + when :snow_leopard then f.bottle + else f.stable + end, f.active_spec - f = LionBottleSpecTestBall.new - assert_equal case MacOS.cat - when :lion then f.bottle - else f.stable - end, f.active_spec + f = LionBottleSpecTestBall.new + assert_equal case MacOS.cat + when :lion then f.bottle + else f.stable + end, f.active_spec - f = AllCatsBottleSpecTestBall.new - assert_equal f.bottle, f.active_spec - end + f = AllCatsBottleSpecTestBall.new + assert_equal f.bottle, f.active_spec end end