Module: nagvis
Branch: master
Commit: 3853e308c9984244ec091d2b01f71ef4df141cef
URL:    
http://nagvis.git.sourceforge.net/git/gitweb.cgi?p=nagvis/nagvis;a=commit;h=3853e308c9984244ec091d2b01f71ef4df141cef

Author: LaMi <[email protected]>
Date:   Sat Feb 27 17:21:34 2010 +0100

Fixed setting permissions on all files in a directory when the directory is 
empty

---

 install.sh |   13 +++++++++----
 1 files changed, 9 insertions(+), 4 deletions(-)

diff --git a/install.sh b/install.sh
index b494c86..81cc87f 100755
--- a/install.sh
+++ b/install.sh
@@ -733,10 +733,15 @@ copy() {
 }
 
 set_perm() {
-       if [ -d "$2" -o -f "$2" ]; then
-               DONE=`log "$2" done` 
-               chmod $1 $2
-               chk_rc "| Error setting permissions for $2" "$DONE"
+       if [ -d "$2" -o -f "$2" -o "${2#${2%?}}" = "*" ]; then
+               # Don't do anything when called with globbing and directory is 
empty
+               if [[ "${2#${2%?}}" = "*" && "`ls -1 "${2%*\*}"`" = "" ]]; then
+                       return 0
+               else
+                       DONE=`log "$2" done` 
+                       chmod $1 $2
+                       chk_rc "| Error setting permissions for $2" "$DONE"
+               fi
        fi
 }
 


------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
Nagvis-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/nagvis-checkins

Reply via email to