aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/macos.rb
diff options
context:
space:
mode:
authorMike McQuaid2012-12-04 12:06:02 +0000
committerMike McQuaid2012-12-04 12:06:02 +0000
commit4b0e663c2c36db0870688e99fc8a28a758968021 (patch)
tree7cb9f88d2432306c3d510be9b3d88a05d2357beb /Library/Homebrew/macos.rb
parent5d7940228ed11ccb7641c3d6d5b66e7dc2e5ef34 (diff)
downloadbrew-4b0e663c2c36db0870688e99fc8a28a758968021.tar.bz2
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.
Diffstat (limited to 'Library/Homebrew/macos.rb')
-rw-r--r--Library/Homebrew/macos.rb21
1 files changed, 17 insertions, 4 deletions
diff --git a/Library/Homebrew/macos.rb b/Library/Homebrew/macos.rb
index c662b953c..8cc8de2d2 100644
--- a/Library/Homebrew/macos.rb
+++ b/Library/Homebrew/macos.rb
@@ -228,11 +228,24 @@ module MacOS extend self
`/usr/sbin/pkgutil --pkg-info "#{id}" 2>/dev/null`.strip
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.
- (Hardware.is_64_bit? or not MacOS.version >= :snow_leopard) \
- and HOMEBREW_PREFIX.to_s == '/usr/local' \
- and HOMEBREW_CELLAR.to_s == '/usr/local/Cellar' \
+ unless Hardware.is_64_bit? or MacOS.version >= :snow_leopard
+ return false unless raise_if_failed
+ 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