aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorMike McQuaid2014-12-14 10:17:29 +0000
committerMike McQuaid2014-12-14 10:17:29 +0000
commit612230a7051c5b16b8be55d559afe230b921e387 (patch)
tree710fb095eef7de26508a8a7b920726a678095bce /Library
parent0ed43d607b49ba0bee266e11d88fb2d03e6d9ccf (diff)
downloadbrew-612230a7051c5b16b8be55d559afe230b921e387.tar.bz2
doctor: check cache directory is writable.
Fixes Homebrew/homebrew#32304. Fixes Homebrew/homebrew#34933.
Diffstat (limited to 'Library')
-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