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
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)

View File

@ -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

View File

@ -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?

View File

@ -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)
},

View File

@ -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'

View File

@ -1,21 +1,8 @@
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
assert_equal case MacOS.cat
@ -33,4 +20,3 @@ class BottleTests < Test::Unit::TestCase
assert_equal f.bottle, f.active_spec
end
end
end