From c6c9aa546f9eaf2e93ae67d95ebb94b383c177fc Mon Sep 17 00:00:00 2001 From: Jack Nagel Date: Tue, 29 Apr 2014 21:51:17 -0500 Subject: xcrun wrapper: skip superenv bin when walking PATH --- Library/ENV/4.3/xcrun | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'Library') 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(" ")} -- cgit v1.2.3