Improve bottle error messages.
On installation or creation of a bottle error out of the current machine does not support bottles. References Homebrew/homebrew#16291.
This commit is contained in:
parent
5d7940228e
commit
4b0e663c2c
@ -10,7 +10,7 @@ def bottle_filename f, bottle_version=nil
|
|||||||
end
|
end
|
||||||
|
|
||||||
def install_bottle? f
|
def install_bottle? f
|
||||||
return true if ARGV.include? '--install-bottle'
|
return true if ARGV.include? '--install-bottle' and MacOS.bottles_supported?(true)
|
||||||
return true if f.downloader and defined? f.downloader.local_bottle_path \
|
return true if f.downloader and defined? f.downloader.local_bottle_path \
|
||||||
and f.downloader.local_bottle_path
|
and f.downloader.local_bottle_path
|
||||||
not ARGV.build_from_source? \
|
not ARGV.build_from_source? \
|
||||||
|
@ -130,7 +130,7 @@ module HomebrewArgvExtension
|
|||||||
end
|
end
|
||||||
|
|
||||||
def build_bottle?
|
def build_bottle?
|
||||||
include? '--build-bottle' and MacOS.bottles_supported?
|
include? '--build-bottle' and MacOS.bottles_supported?(true)
|
||||||
end
|
end
|
||||||
|
|
||||||
def build_from_source?
|
def build_from_source?
|
||||||
|
@ -228,11 +228,24 @@ module MacOS extend self
|
|||||||
`/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?
|
def bottles_supported? raise_if_failed=false
|
||||||
# We support bottles on all versions of OS X except 32-bit Snow Leopard.
|
# We support bottles on all versions of OS X except 32-bit Snow Leopard.
|
||||||
(Hardware.is_64_bit? or not MacOS.version >= :snow_leopard) \
|
unless Hardware.is_64_bit? or MacOS.version >= :snow_leopard
|
||||||
and HOMEBREW_PREFIX.to_s == '/usr/local' \
|
return false unless raise_if_failed
|
||||||
and HOMEBREW_CELLAR.to_s == '/usr/local/Cellar' \
|
raise "Bottles are not supported on 32-bit Snow Leopard."
|
||||||
|
end
|
||||||
|
|
||||||
|
unless HOMEBREW_PREFIX.to_s == '/usr/local'
|
||||||
|
return false unless raise_if_failed
|
||||||
|
raise "Bottles are only supported with a /usr/local prefix."
|
||||||
|
end
|
||||||
|
|
||||||
|
unless HOMEBREW_CELLAR.to_s == '/usr/local/Cellar'
|
||||||
|
return false unless raise_if_failed
|
||||||
|
raise "Bottles are only supported with a /usr/local/Cellar cellar."
|
||||||
|
end
|
||||||
|
|
||||||
|
true
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user