aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorMisty De Meo2013-01-21 23:14:33 -0600
committerMisty De Meo2013-01-26 22:53:29 -0600
commit88609dd6eda7f7ec9bbd4be2408ec0dae891b675 (patch)
treebc371795c1faa97881a31f0eb57b451bd8deab76 /Library
parentadf90691f146fdf3abef3dda6171d38f7fb2cdf7 (diff)
downloadbrew-88609dd6eda7f7ec9bbd4be2408ec0dae891b675.tar.bz2
xcrun: actually try fallbacks
xcrun has a lot of fallbacks if the first case fails but never actually reaches them on CLT systems since it doesn't check the validity of the first path before executing it. (When should it reach these? Mainly for non-Xcode compilers we support, e.g. apple-gcc42 which can be found by xcrun but which isn't in /usr/bin) The xcrun invocation also needed chomping.
Diffstat (limited to 'Library')
-rwxr-xr-xLibrary/ENV/4.3/xcrun6
1 files changed, 4 insertions, 2 deletions
diff --git a/Library/ENV/4.3/xcrun b/Library/ENV/4.3/xcrun
index 3526c804c..68fda5829 100755
--- a/Library/ENV/4.3/xcrun
+++ b/Library/ENV/4.3/xcrun
@@ -8,14 +8,16 @@ require "#{File.dirname __FILE__}/../libsuperenv"
SUPERBIN = __FILE__.dirname.cleanpath.freeze
exec "/usr/bin/xcrun", *ARGV if ARGV.empty? or ARGV[0][0..0] == '-'
-exec "/usr/bin/#{ARGV.shift}", *ARGV unless ENV['HOMEBREW_SDKROOT'].directory?
+if File.exist?("/usr/bin/#{ARGV.first}")
+ exec "/usr/bin/#{ARGV.shift}", *ARGV unless ENV['HOMEBREW_SDKROOT'].directory?
+end
def try path
exec path, *ARGV if File.executable?(path) and path.cleanpath.dirname != SUPERBIN
end
arg0 = ARGV.shift
-try `/usr/bin/xcrun --find #{arg0}`
+try `/usr/bin/xcrun --find #{arg0}`.chomp
# Nuts, Xcode is not setup properly or something. Try to find the tools anyway!
try "/Applications/Xcode.app/Contents/Developer/usr/bin/#{arg0}"
try "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/#{arg0}"