aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMax Howell2012-08-30 09:45:07 -0400
committerMax Howell2012-08-30 09:45:33 -0400
commit313423d8ee33d80261b3a3045bb53aa14fda6846 (patch)
tree8906b4194780b3420e908ff079f169efb4b277c7
parent4197a4872d33495183f10a9964f8fbafb3c9415c (diff)
downloadhomebrew-313423d8ee33d80261b3a3045bb53aa14fda6846.tar.bz2
Put user's PATHs at end of superenv PATH
Making sure to remove X11, should be safe if this order is kept. Refs #14519. Fixes #14544.
-rw-r--r--Library/Homebrew/superenv.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/Library/Homebrew/superenv.rb b/Library/Homebrew/superenv.rb
index 1fd8b4031..9300d39f8 100644
--- a/Library/Homebrew/superenv.rb
+++ b/Library/Homebrew/superenv.rb
@@ -104,6 +104,7 @@ class << ENV
paths << HOMEBREW_PREFIX/:bin
paths << "#{MacSystem.x11_prefix}/bin" if x11?
paths += %w{/usr/bin /bin /usr/sbin /sbin}
+ paths += ORIGINAL_PATHS.map{|pn| pn.realpath.to_s rescue nil } - %w{/usr/X11/bin /opt/X11/bin}
paths.to_path_s
end
@@ -213,7 +214,7 @@ end
class Array
def to_path_s
- map(&:to_s).select{|s| s and File.directory? s }.join(':').chuzzle
+ map(&:to_s).uniq.select{|s| File.directory? s }.join(':').chuzzle
end
end