aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorXu Cheng2015-09-29 16:19:32 +0800
committerXu Cheng2015-09-30 13:54:04 +0800
commitff132a9ddbbb96a57a3e48c870577d35c1956b99 (patch)
tree430c0b0335c336d7cb5652557716516e46a0aa24 /Library
parent3c54d12cece2dab09fb67976bc2fcc57a6b83604 (diff)
downloadbrew-ff132a9ddbbb96a57a3e48c870577d35c1956b99.tar.bz2
doctor: add check_access_homebrew_repository
Diffstat (limited to 'Library')
-rw-r--r--Library/Homebrew/cmd/doctor.rb11
1 files changed, 10 insertions, 1 deletions
diff --git a/Library/Homebrew/cmd/doctor.rb b/Library/Homebrew/cmd/doctor.rb
index a919a0fbd..d42b1520f 100644
--- a/Library/Homebrew/cmd/doctor.rb
+++ b/Library/Homebrew/cmd/doctor.rb
@@ -424,10 +424,18 @@ class Checks
__check_subdir_access "share/man"
end
+ def check_access_homebrew_repository
+ unless HOMEBREW_REPOSITORY.writable_real? then <<-EOS.undent
+ The #{HOMEBREW_REPOSITORY} is not writable.
+ You should probably `chown` #{HOMEBREW_REPOSITORY}
+ EOS
+ end
+ end
+
def check_access_usr_local
return unless HOMEBREW_PREFIX.to_s == "/usr/local"
- unless File.writable_real?("/usr/local") then <<-EOS.undent
+ unless HOMEBREW_PREFIX.writable_real? then <<-EOS.undent
The /usr/local directory is not writable.
Even if this directory was writable when you installed Homebrew, other
software may change permissions on this directory. Some versions of the
@@ -435,6 +443,7 @@ class Checks
You should probably change the ownership and permissions of /usr/local
back to your user account.
+ sudo chown $(whoami):admin /usr/local
EOS
end
end