aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/cmd
diff options
context:
space:
mode:
authorMike McQuaid2014-12-14 10:17:29 +0000
committerMike McQuaid2014-12-14 10:17:29 +0000
commit2448dfeef1c0cfced42c29978288c3fd37299b37 (patch)
tree00deb2c33cecaaed859c5d09fadd0cc818739031 /Library/Homebrew/cmd
parentd9665b387c51f0b3bddf1ad503b36419929f4108 (diff)
downloadhomebrew-2448dfeef1c0cfced42c29978288c3fd37299b37.tar.bz2
doctor: check cache directory is writable.
Fixes #32304. Fixes #34933.
Diffstat (limited to 'Library/Homebrew/cmd')
-rw-r--r--Library/Homebrew/cmd/doctor.rb13
1 files changed, 13 insertions, 0 deletions
diff --git a/Library/Homebrew/cmd/doctor.rb b/Library/Homebrew/cmd/doctor.rb
index 820dd8897..eef628245 100644
--- a/Library/Homebrew/cmd/doctor.rb
+++ b/Library/Homebrew/cmd/doctor.rb
@@ -462,6 +462,19 @@ def check_access_logs
end
end
+def check_access_cache
+ if HOMEBREW_CACHE.exist? && !HOMEBREW_CACHE.writable_real?
+ <<-EOS.undent
+ #{HOMEBREW_CACHE} isn't writable.
+ This can happen if you ran `brew install` or `brew fetch` as another user.
+
+ Homebrew caches downloaded files to this location.
+
+ You should probably `chown` #{HOMEBREW_CACHE}
+ EOS
+ end
+end
+
def check_ruby_version
ruby_version = MacOS.version >= "10.9" ? "2.0" : "1.8"
if RUBY_VERSION[/\d\.\d/] != ruby_version then <<-EOS.undent