aboutsummaryrefslogtreecommitdiffstats
path: root/Library/ENV
diff options
context:
space:
mode:
authorJack Nagel2014-04-29 21:51:17 -0500
committerJack Nagel2014-04-29 21:51:17 -0500
commit8d4fe2fe7382284e826f219b9308825df1110e63 (patch)
treefe42ab81887d28e69fbc7718159e2a7448a6afff /Library/ENV
parent0c43d9d1876df1a0c35e7ea27732e7a41a3a3132 (diff)
downloadhomebrew-8d4fe2fe7382284e826f219b9308825df1110e63.tar.bz2
xcrun wrapper: skip superenv bin when walking PATH
Diffstat (limited to 'Library/ENV')
-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(" ")}