aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorAdam Vandenberg2010-03-31 15:38:20 -0700
committerAdam Vandenberg2010-04-06 08:22:29 -0700
commit169aa682e0eeebba3ea236e3c6076412707b21b4 (patch)
treee2ab27fe895005898e6a3431cb1a60c214148680 /Library
parent53b1e8ed2b9cfda67988eb6c1c9b973be607e147 (diff)
downloadbrew-169aa682e0eeebba3ea236e3c6076412707b21b4.tar.bz2
Check for root owned locale folders.
Diffstat (limited to 'Library')
-rw-r--r--Library/Homebrew/brew_doctor.rb27
1 files changed, 27 insertions, 0 deletions
diff --git a/Library/Homebrew/brew_doctor.rb b/Library/Homebrew/brew_doctor.rb
index 9981bcb50..290fd0203 100644
--- a/Library/Homebrew/brew_doctor.rb
+++ b/Library/Homebrew/brew_doctor.rb
@@ -54,6 +54,32 @@ def check_gcc_versions
end
def check_share_locale
+ # If PREFIX/share/locale already exists, "sudo make install" of
+ # non-brew installed software may cause installation failures.
+ locale = HOMEBREW_PREFIX+'share/locale'
+ return unless locale.exist?
+
+ cant_read = []
+
+ locale.find do |d|
+ next unless d.directory?
+ cant_read << d unless d.writable?
+ end
+
+ cant_read.sort!
+ if cant_read.count > 0
+ puts <<-EOS.undent
+ Some folders in #{locale} aren't writable.
+ This can happen if you "sudo make install" software that isn't managed
+ by Homebrew. If a brew tries to add locale information to one of these
+ folders, then the install will fail during the link step.
+ You should probably `chown` them:
+
+ EOS
+ puts *cant_read.collect { |f| " #{f}" }
+ puts
+ end
+
end
def check_usr_bin_ruby
@@ -90,6 +116,7 @@ def brew_doctor
check_gcc_versions
check_for_other_package_managers
check_for_x11
+ check_share_locale
exit! 0
else