stop Xcode tools from overriding deps when CLT is not installed

Closes Homebrew/homebrew#30641.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
This commit is contained in:
Camillo Lugaresi 2014-04-28 15:32:53 -07:00 committed by Jack Nagel
parent b78308d2d5
commit 4001c6f8f1

View File

@ -110,6 +110,9 @@ module Superenv
def determine_path def determine_path
paths = [Superenv.bin] paths = [Superenv.bin]
# Formula dependencies can override standard tools.
paths += deps.map { |dep| "#{HOMEBREW_PREFIX}/opt/#{dep}/bin" }
# On 10.9, there are shims for all tools in /usr/bin. # On 10.9, there are shims for all tools in /usr/bin.
# On 10.7 and 10.8 we need to add these directories ourselves. # On 10.7 and 10.8 we need to add these directories ourselves.
if MacOS::Xcode.without_clt? && MacOS.version <= "10.8" if MacOS::Xcode.without_clt? && MacOS.version <= "10.8"
@ -117,7 +120,6 @@ module Superenv
paths << "#{MacOS::Xcode.toolchain_path}/usr/bin" paths << "#{MacOS::Xcode.toolchain_path}/usr/bin"
end end
paths += deps.map { |dep| "#{HOMEBREW_PREFIX}/opt/#{dep}/bin" }
paths << MacOS::X11.bin.to_s if x11? paths << MacOS::X11.bin.to_s if x11?
paths += %w{/usr/bin /bin /usr/sbin /sbin} paths += %w{/usr/bin /bin /usr/sbin /sbin}