aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/macos/xcode.rb
diff options
context:
space:
mode:
authorJack Nagel2012-09-14 13:24:28 -0500
committerJack Nagel2012-12-12 23:33:29 -0600
commit5ce1caa1f3679244ed120e3f091001c5afabcf74 (patch)
tree61a53da953822ac88a4dffcfa68498b9cb84e25f /Library/Homebrew/macos/xcode.rb
parentfe4e73db323c7245f26b973ce78fa28f7e4433d4 (diff)
downloadbrew-5ce1caa1f3679244ed120e3f091001c5afabcf74.tar.bz2
Improve Xcode and CLT config reporting
We support three configurations: Xcode-only, CLT-only, and Xcode with CLT. Our configuration output should correctly reflect this. While MacOS::Xcode.version has to continue to return a guess if Xcode is not installed in order to maintain backwards compatibility, this is an implementation detail that we don't need to expose to the user. And it makes `brew --config` output confusing. So let's only print the "Xcode" line when an actual Xcode installation is present. This makes it easy to quickly figure out which of the three possible configurations the user is running. Addresses Homebrew/homebrew#14941, more or less.
Diffstat (limited to 'Library/Homebrew/macos/xcode.rb')
-rw-r--r--Library/Homebrew/macos/xcode.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/Library/Homebrew/macos/xcode.rb b/Library/Homebrew/macos/xcode.rb
index 3640f1a68..ab297f2c5 100644
--- a/Library/Homebrew/macos/xcode.rb
+++ b/Library/Homebrew/macos/xcode.rb
@@ -147,6 +147,14 @@ module MacOS::Xcode extend self
def provides_gcc?
version.to_f < 4.3
end
+
+ def default_prefix?
+ if version.to_f < 4.3
+ %r{^/Developer} === prefix
+ else
+ %r{^/Applications/Xcode.app} === prefix
+ end
+ end
end
module MacOS::CLT extend self