aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCharlie Sharpsteen2012-09-23 12:22:15 -0500
committerCharlie Sharpsteen2012-09-24 16:31:51 -0500
commit5608ad6dae59a3e2bcf45ee705a37ec20cd8e290 (patch)
treea9c7d38491bced43ae8e01ab6999cf04e7f27778
parent96905ebc241d13b01a32f861eeb24a36e8303fe0 (diff)
downloadhomebrew-5608ad6dae59a3e2bcf45ee705a37ec20cd8e290.tar.bz2
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 `File.executable?`.
-rw-r--r--install2
1 files changed, 1 insertions, 1 deletions
diff --git a/install b/install
index e9d7fca77..2749d99dc 100644
--- a/install
+++ b/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| File.directory? d and not File.writable? d }
+ select{ |d| File.directory? 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?