This repository has been archived by the owner. It is now read-only.
Browse files

Check all file modes, not just writable

We run a `chmod g+rwx` to set read, write and execute permissions but only use
`File.writable?` to detect which directories need this. Since we are setting
read and execute permissions, we should also use `File.readable?` and
  • Loading branch information...
Sharpie committed Sep 23, 2012
1 parent 96905eb commit 5608ad6dae59a3e2bcf45ee705a37ec20cd8e290
Showing with 1 addition and 1 deletion.
  1. +1 −1 install
@@ -108,7 +108,7 @@ chmods = %w( . bin etc include lib lib/pkgconfig Library sbin share var var/log
share/man/man5 share/man/man6 share/man/man7 share/man/man8
share/info share/doc share/aclocal ).
map{ |d| "#{HOMEBREW_PREFIX}/#{d}" }.
- select{ |d| d and not File.writable? d }
+ select{ |d| d and (not File.readable? d or not File.writable? d or not File.executable? d) }
chgrps = chmods.reject{ |d| File.stat(d).grpowned? }
unless chmods.empty?

0 comments on commit 5608ad6

Please sign in to comment.