Skip to content
Snippets Groups Projects
Commit 4a4186c5 authored by Adam Vandenberg's avatar Adam Vandenberg
Browse files

brew doctor - only check unique path folders

parent f523662c
No related branches found
No related tags found
No related merge requests found
......@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment