aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/os
diff options
context:
space:
mode:
authorMartin Afanasjew2015-10-23 00:07:12 +0200
committerMike McQuaid2015-10-23 12:34:44 +0100
commit30cad0608ff6c22051b5a1e0f3bf566d643bb673 (patch)
tree7f513efa969e9dfd38d1f158cc2e968db6ab5902 /Library/Homebrew/os
parent7c7b7bf97f2ed1a86b4a9edd12744e4d142949c4 (diff)
downloadbrew-30cad0608ff6c22051b5a1e0f3bf566d643bb673.tar.bz2
os: centralize check for pre-release OS X versions
Provide `OS::Mac.prerelease?` for pre-release checks and use it where appropriate. This should simplify updating the test once a new OS X release lands. This also fixes a bug in `BuildError#dump`, where an empty warning message was printed on El Capitan after a failed from-source build, because the check there and the one in `check_for_unsupported_osx` were out of sync. Closes Homebrew/homebrew#45257. Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
Diffstat (limited to 'Library/Homebrew/os')
-rw-r--r--Library/Homebrew/os/mac.rb5
-rw-r--r--Library/Homebrew/os/mac/xcode.rb2
2 files changed, 6 insertions, 1 deletions
diff --git a/Library/Homebrew/os/mac.rb b/Library/Homebrew/os/mac.rb
index 3568f7158..e8c2f76bc 100644
--- a/Library/Homebrew/os/mac.rb
+++ b/Library/Homebrew/os/mac.rb
@@ -22,6 +22,11 @@ module OS
@full_version ||= Version.new(`/usr/bin/sw_vers -productVersion`.chomp)
end
+ def prerelease?
+ # TODO: bump version when new OS is released
+ version >= "10.12"
+ end
+
def cat
version.to_sym
end
diff --git a/Library/Homebrew/os/mac/xcode.rb b/Library/Homebrew/os/mac/xcode.rb
index 8a2da48ec..d41dec26d 100644
--- a/Library/Homebrew/os/mac/xcode.rb
+++ b/Library/Homebrew/os/mac/xcode.rb
@@ -18,7 +18,7 @@ module OS
when "10.11" then "7.0.1"
else
# Default to newest known version of Xcode for unreleased OSX versions.
- if MacOS.version > "10.11"
+ if OS::Mac.prerelease?
"7.0.1"
else
raise "OS X '#{MacOS.version}' is invalid"