Ensure the files have the correct permissions prior to staging

git-svn-id: https://svn.apache.org/repos/asf/buildr/trunk@1447000 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/rakelib/stage.rake b/rakelib/stage.rake
index 6aa5090..0a46917 100644
--- a/rakelib/stage.rake
+++ b/rakelib/stage.rake
@@ -92,6 +92,13 @@
   gpg_arg = args.gpg || ENV['gpg']
   mkpath '_staged'
 
+  lambda do
+    puts 'Ensuring all files have appropraite group and other permissions...'
+    sh 'find . -type f | xargs chmod go+r'
+    sh 'find . -type d | xargs chmod go+rx'
+    puts '[X] File permissions updated/validted.'
+  end.call
+
   # Start by figuring out what has changed.
   lambda do
     puts 'Looking for changes between this release and previous one ...'