From 5707787358b795c5c2e9891346203e0283e64d0b Mon Sep 17 00:00:00 2001 From: Adam Vandenberg Date: Wed, 29 Sep 2010 11:56:58 -0700 Subject: [PATCH] brew-doctor - add access check to include --- Library/Homebrew/brew_doctor.rb | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/Library/Homebrew/brew_doctor.rb b/Library/Homebrew/brew_doctor.rb index 96abb371fe..7e9935c17d 100644 --- a/Library/Homebrew/brew_doctor.rb +++ b/Library/Homebrew/brew_doctor.rb @@ -204,6 +204,24 @@ def check_access_pkgconfig 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} + + EOS + end +end + def check_usr_bin_ruby if /^1\.9/.match RUBY_VERSION puts <<-EOS.undent @@ -544,6 +562,7 @@ def brew_doctor check_for_nonstandard_x11 check_access_share_locale check_access_share_man + check_access_include check_user_path check_which_pkg_config check_pkg_config_paths