aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorAdam Vandenberg2011-03-28 11:48:45 -0700
committerAdam Vandenberg2011-03-28 11:48:45 -0700
commit71c074dbed11a05bdd2223465b1cd10cbef8064f (patch)
tree54680403326b9e147873d9b0cdf5df928661ee4e /Library
parentcb73726048016fb48b991c2fb009e1e374603b40 (diff)
downloadhomebrew-71c074dbed11a05bdd2223465b1cd10cbef8064f.tar.bz2
brew doctor - also check permisisons on share
Diffstat (limited to 'Library')
-rw-r--r--Library/Homebrew/cmd/doctor.rb69
1 files changed, 29 insertions, 40 deletions
diff --git a/Library/Homebrew/cmd/doctor.rb b/Library/Homebrew/cmd/doctor.rb
index 5ada729b5..10f77ade1 100644
--- a/Library/Homebrew/cmd/doctor.rb
+++ b/Library/Homebrew/cmd/doctor.rb
@@ -170,58 +170,46 @@ def check_access_share_man
__check_subdir_access 'share/man'
end
-def check_access_pkgconfig
- # If PREFIX/lib/pkgconfig already exists, "sudo make install" of
- # non-brew installed software may cause installation failures.
- pkgconfig = HOMEBREW_PREFIX+'lib/pkgconfig'
- return unless pkgconfig.exist?
+def __check_folder_access base, msg
+ folder = HOMEBREW_PREFIX+base
+ return unless folder.exist?
- unless pkgconfig.writable?
+ unless folder.writable?
puts <<-EOS.undent
- #{pkgconfig} isn't writable.
+ #{folder} isn't writable.
This can happen if you "sudo make install" software that isn't managed
- by Homebrew. If a brew tries to write a .pc file to this folder, the
- install will fail during the link step.
+ by Homebrew.
+
+ #{msg}
- You should probably `chown` #{pkgconfig}
+ You should probably `chown` #{folder}
EOS
end
end
-def check_access_include
- # Installing MySQL manually (for instance) can chown include to root.
- include_folder = HOMEBREW_PREFIX+'include'
- return unless include_folder.exist?
-
- unless include_folder.writable?
- puts <<-EOS.undent
- #{include_folder} isn't writable.
- This can happen if you "sudo make install" software that isn't managed
- by Homebrew. If a brew tries to write a header file to this folder, the
- install will fail during the link step.
-
- You should probably `chown` #{include_folder}
+def check_access_pkgconfig
+ __check_folder_access 'lib/pkgconfig',
+ 'If a brew tries to write a .pc file to this folder, the install will\n'+
+ 'fail during the link step.'
+end
- EOS
- end
+def check_access_include
+ __check_folder_access 'include',
+ 'If a brew tries to write a header file to this folder, the install will\n'+
+ 'fail during the link step.'
end
def check_access_etc
- etc_folder = HOMEBREW_PREFIX+'etc'
- return unless etc_folder.exist?
-
- unless etc_folder.writable?
- puts <<-EOS.undent
- #{etc_folder} isn't writable.
- This can happen if you "sudo make install" software that isn't managed
- by Homebrew. If a brew tries to write a file to this folder, the install
- will fail during the link step.
-
- You should probably `chown` #{etc_folder}
+ __check_folder_access 'etc',
+ 'If a brew tries to write a file to this folder, the install will\n'+
+ 'fail during the link step.'
+end
- EOS
- end
+def check_access_share
+ __check_folder_access 'share',
+ 'If a brew tries to write a file to this folder, the install will\n'+
+ 'fail during the link step.'
end
def check_usr_bin_ruby
@@ -598,10 +586,11 @@ module Homebrew extend self
check_for_other_package_managers
check_for_x11
check_for_nonstandard_x11
- check_access_share_locale
- check_access_share_man
check_access_include
check_access_etc
+ check_access_share
+ check_access_share_locale
+ check_access_share_man
check_user_path
check_which_pkg_config
check_pkg_config_paths