aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorJack Nagel2014-04-29 21:51:17 -0500
committerJack Nagel2014-04-29 21:51:17 -0500
commitc6c9aa546f9eaf2e93ae67d95ebb94b383c177fc (patch)
treed2d3aeec5bdbba493cb80f29f45a3e3b5008505f /Library
parent259bbdf76c67167cf43234bf6774d90f70aebd2d (diff)
downloadbrew-c6c9aa546f9eaf2e93ae67d95ebb94b383c177fc.tar.bz2
xcrun wrapper: skip superenv bin when walking PATH
Diffstat (limited to 'Library')
-rwxr-xr-xLibrary/ENV/4.3/xcrun9
1 files changed, 6 insertions, 3 deletions
diff --git a/Library/ENV/4.3/xcrun b/Library/ENV/4.3/xcrun
index fe4f276a7..1dca66b65 100755
--- a/Library/ENV/4.3/xcrun
+++ b/Library/ENV/4.3/xcrun
@@ -32,9 +32,12 @@ end
arg0 = ARGV.shift
try `/usr/bin/xcrun --find #{arg0} 2>/dev/null`.chomp
-# xcrun won't always be able to find Homebrew's apple-gcc42,
-# even when it's in the PATH
-ENV["PATH"].split(File::PATH_SEPARATOR).each { |p| try File.join(p, arg0) }
+paths = ENV["PATH"].split(File::PATH_SEPARATOR)
+paths.delete(SUPERBIN)
+paths.each do |path|
+ exe = File.join(path, arg0)
+ exec(exe, *ARGV) if File.executable?(exe)
+end
abort <<-EOS
Failed to execute: #{arg0} #{ARGV.join(" ")}