Support 32-bit 10.6 bottles.

Closes Homebrew/homebrew#17735.

Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
This commit is contained in:
Mike McQuaid 2013-03-01 17:44:58 +00:00
parent 20c0ddc401
commit 8f35793020
6 changed files with 17 additions and 41 deletions

View File

@ -14,7 +14,6 @@ def install_bottle? f
and f.downloader.local_bottle_path and f.downloader.local_bottle_path
return false if ARGV.build_from_source? return false if ARGV.build_from_source?
return false unless MacOS.bottles_supported?
return false unless f.pour_bottle? return false unless f.pour_bottle?
return false unless f.build.used_options.empty? return false unless f.build.used_options.empty?
return false unless bottle_current?(f) return false unless bottle_current?(f)

View File

@ -74,7 +74,7 @@ module Homebrew extend self
def info_formula f def info_formula f
specs = [] specs = []
stable = "stable #{f.stable.version}" if f.stable 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 << stable if stable
specs << "devel #{f.devel.version}" if f.devel specs << "devel #{f.devel.version}" if f.devel
specs << "HEAD" if f.head specs << "HEAD" if f.head

View File

@ -126,7 +126,7 @@ module HomebrewArgvExtension
end end
def build_bottle? def build_bottle?
include? '--build-bottle' and MacOS.bottles_supported?(true) include? '--build-bottle'
end end
def build_from_source? def build_from_source?

View File

@ -478,7 +478,7 @@ class Formula
"homepage" => homepage, "homepage" => homepage,
"versions" => { "versions" => {
"stable" => (stable.version.to_s if stable), "stable" => (stable.version.to_s if stable),
"bottle" => bottle && MacOS.bottles_supported? || false, "bottle" => bottle || false,
"devel" => (devel.version.to_s if devel), "devel" => (devel.version.to_s if devel),
"head" => (head.version.to_s if head) "head" => (head.version.to_s if head)
}, },

View File

@ -11,7 +11,8 @@ module MacOS extend self
def cat def cat
if version == :mountain_lion then :mountain_lion if version == :mountain_lion then :mountain_lion
elsif version == :lion then :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 elsif version == :leopard then :leopard
else nil else nil
end end
@ -234,16 +235,6 @@ module MacOS extend self
def pkgutil_info id def pkgutil_info id
`/usr/sbin/pkgutil --pkg-info "#{id}" 2>/dev/null`.strip `/usr/sbin/pkgutil --pkg-info "#{id}" 2>/dev/null`.strip
end 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 end
require 'macos/xcode' require 'macos/xcode'

View File

@ -1,36 +1,22 @@
require 'testing_env' require 'testing_env'
require 'test/testball' 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 class BottleTests < Test::Unit::TestCase
def test_bottle_spec_selection def test_bottle_spec_selection
MacOS.bottles_are_supported do f = SnowLeopardBottleSpecTestBall.new
f = SnowLeopardBottleSpecTestBall.new
assert_equal case MacOS.cat assert_equal case MacOS.cat
when :snow_leopard then f.bottle when :snow_leopard then f.bottle
else f.stable else f.stable
end, f.active_spec end, f.active_spec
f = LionBottleSpecTestBall.new f = LionBottleSpecTestBall.new
assert_equal case MacOS.cat assert_equal case MacOS.cat
when :lion then f.bottle when :lion then f.bottle
else f.stable else f.stable
end, f.active_spec end, f.active_spec
f = AllCatsBottleSpecTestBall.new f = AllCatsBottleSpecTestBall.new
assert_equal f.bottle, f.active_spec assert_equal f.bottle, f.active_spec
end
end end
end end