aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/os
diff options
context:
space:
mode:
authorJack Nagel2014-05-02 16:48:59 -0500
committerJack Nagel2014-05-02 16:48:59 -0500
commitf6d5d812dc271f3e01311c1b8a72f3a2ec2c06a9 (patch)
treed627816718f7bb76b619b2bdf1cada3a7a823cfe /Library/Homebrew/os
parent2c6d4973b96cbad71c868923bc456958582be36f (diff)
downloadbrew-f6d5d812dc271f3e01311c1b8a72f3a2ec2c06a9.tar.bz2
Simpler Xcode prefix detection code
Diffstat (limited to 'Library/Homebrew/os')
-rw-r--r--Library/Homebrew/os/mac/xcode.rb21
1 files changed, 11 insertions, 10 deletions
diff --git a/Library/Homebrew/os/mac/xcode.rb b/Library/Homebrew/os/mac/xcode.rb
index 5982ab6be..18c9b5f5e 100644
--- a/Library/Homebrew/os/mac/xcode.rb
+++ b/Library/Homebrew/os/mac/xcode.rb
@@ -33,16 +33,17 @@ module OS
end
def prefix
- @prefix ||= begin
- path = Pathname.new(MacOS.active_developer_dir)
- if path != CLT::MAVERICKS_PKG_PATH and path.absolute? \
- and File.executable? "#{path}/usr/bin/make"
- path
- elsif (path = bundle_path)
- path += "Contents/Developer"
- path if File.executable? "#{path}/usr/bin/make"
+ @prefix ||=
+ begin
+ dir = MacOS.active_developer_dir
+
+ if dir.empty? || dir == CLT::MAVERICKS_PKG_PATH || !File.directory?(dir)
+ path = bundle_path
+ path.join("Contents", "Developer") if path
+ else
+ Pathname.new(dir)
+ end
end
- end
end
def toolchain_path
@@ -146,7 +147,7 @@ module OS
STANDALONE_PKG_ID = "com.apple.pkg.DeveloperToolsCLILeo"
FROM_XCODE_PKG_ID = "com.apple.pkg.DeveloperToolsCLI"
MAVERICKS_PKG_ID = "com.apple.pkg.CLTools_Executables"
- MAVERICKS_PKG_PATH = Pathname.new("/Library/Developer/CommandLineTools")
+ MAVERICKS_PKG_PATH = "/Library/Developer/CommandLineTools"
# Returns true even if outdated tools are installed, e.g.
# tools from Xcode 4.x on 10.9