diff options
| author | Adam Vandenberg | 2011-03-29 12:45:54 -0700 |
|---|---|---|
| committer | Adam Vandenberg | 2011-03-29 12:45:54 -0700 |
| commit | 4a4186c58383583da69a347b6c1537fa95dd4629 (patch) | |
| tree | 96cf09cb153c0d5afdb3eeaf25976bb8c887c6a7 /Library | |
| parent | f523662ce594f97a1b69d1aec478f9c3c206d6fc (diff) | |
| download | brew-4a4186c58383583da69a347b6c1537fa95dd4629.tar.bz2 | |
brew doctor - only check unique path folders
Diffstat (limited to 'Library')
| -rw-r--r-- | Library/Homebrew/cmd/doctor.rb | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/Library/Homebrew/cmd/doctor.rb b/Library/Homebrew/cmd/doctor.rb index 9ff4db57b..be9787766 100644 --- a/Library/Homebrew/cmd/doctor.rb +++ b/Library/Homebrew/cmd/doctor.rb @@ -28,6 +28,12 @@ def is_prefix? prefix, longer_string longer_string.to_s[0,p.length] == p end + +def path_folders + ENV['PATH'].split(':').collect{|p| File.expand_path p}.uniq +end + + # Installing MacGPG2 interferes with Homebrew in a big way # http://sourceforge.net/projects/macgpg2/files/ def check_for_macgpg2 @@ -240,9 +246,7 @@ def check_user_path seen_prefix_sbin = false seen_usr_bin = false - paths = ENV['PATH'].split(':').collect{|p| File.expand_path p} - - paths.each do |p| + path_folders.each do |p| if p == '/usr/bin' seen_usr_bin = true unless seen_prefix_bin @@ -375,8 +379,7 @@ def check_for_config_scripts config_scripts = [] - paths = ENV['PATH'].split(':').collect{|p| File.expand_path p} - paths.each do |p| + path_folders.each do |p| next if ['/usr/bin', '/usr/sbin', '/usr/X11/bin', "#{HOMEBREW_PREFIX}/bin", "#{HOMEBREW_PREFIX}/sbin"].include? p next if p =~ %r[^(#{real_cellar.to_s}|#{HOMEBREW_CELLAR.to_s})] @@ -441,7 +444,7 @@ def check_for_multiple_volumes real_cellar = HOMEBREW_CELLAR.realpath tmp_prefix = ENV['HOMEBREW_TEMP'] || '/tmp' - tmp=Pathname.new `/usr/bin/mktemp -d #{tmp_prefix}/homebrew-brew-doctor-XXXX`.strip + tmp = Pathname.new `/usr/bin/mktemp -d #{tmp_prefix}/homebrew-brew-doctor-XXXX`.strip real_temp = tmp.realpath.parent where_cellar = volumes.which real_cellar |
