aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMax Howell2012-02-20 18:25:13 +0000
committerMax Howell2012-02-20 18:25:13 +0000
commit83e9dbf266d2140d4761c645d64864a18e341a62 (patch)
tree97a3cfd3fa301fd67f9f175bd00846ea9987a217
parent2759dcf06b0f646ff46f7f8057abfde3f7a9bc65 (diff)
downloadbrew-83e9dbf266d2140d4761c645d64864a18e341a62.tar.bz2
Be more verbose for the /usr/bin /usr/local/bin PATH doctor
-rw-r--r--Library/Homebrew/cmd/doctor.rb13
1 files changed, 9 insertions, 4 deletions
diff --git a/Library/Homebrew/cmd/doctor.rb b/Library/Homebrew/cmd/doctor.rb
index d481ac463..b1f190bba 100644
--- a/Library/Homebrew/cmd/doctor.rb
+++ b/Library/Homebrew/cmd/doctor.rb
@@ -349,15 +349,20 @@ def check_user_path
unless seen_prefix_bin
# only show the doctor message if there are any conflicts
# rationale: a default install should not trigger any brew doctor messages
- if Dir["#{HOMEBREW_PREFIX}/bin/*"].any? {|fn| File.exist? "/usr/bin/#{File.basename fn}"}
+ conflicts = Dir["#{HOMEBREW_PREFIX}/bin/*"].
+ select {|fn| File.exist? "/usr/bin/#{File.basename fn}"}.
+ map {|fn| File.basename fn}
+ if conflicts.size
ohai "/usr/bin occurs before #{HOMEBREW_PREFIX}/bin"
puts <<-EOS.undent
This means that system-provided programs will be used instead of those
- provided by Homebrew. This is an issue if you eg. brew installed Python.
+ provided by Homebrew. The following tools exist at both paths:
- Consider editing your .bashrc to put:
- #{HOMEBREW_PREFIX}/bin
+ #{conflicts * "\n "}
+
+ Consider editing your .bashrc to put #{HOMEBREW_PREFIX}/bin
ahead of /usr/bin in your PATH.
+
EOS
end
end