]> gitweb.fluxo.info Git - simplepkg.git/commitdiff
jail-update: small change
authorrhatto <rhatto@04377dda-e619-0410-9926-eae83683ac58>
Thu, 5 Apr 2007 15:36:43 +0000 (15:36 +0000)
committerrhatto <rhatto@04377dda-e619-0410-9926-eae83683ac58>
Thu, 5 Apr 2007 15:36:43 +0000 (15:36 +0000)
git-svn-id: svn+slack://slack.fluxo.info/var/svn/simplepkg@242 04377dda-e619-0410-9926-eae83683ac58

trunk/src/jail-commit

index c2d66b5daf799fdd9bc947146d048080bd894608..1142cb8e9f531a040af42a3574f7b46b8fd7185d 100755 (executable)
@@ -45,7 +45,7 @@ function template_merge {
     return 1
   fi
 
-  echo "" > $TEMPLATE_BASE.perms
+  echo "" > $TEMPLATE_BASE.perms.tmp
   cd $TEMPLATE_BASE.d
 
   for file in `find | grep -v -e "/.svn$" | grep -v -e "/.svn/" | grep -v -e  "^\.$"`; do
@@ -67,14 +67,17 @@ function template_merge {
       perms="`numeric_perm $1/$file`"
       owner="`get_owner $1/$file`"
       group="`get_group $1/$file`"
-      echo "$file;$owner;$group;$perms" >> $TEMPLATE_BASE.perms
+      echo "$file;$owner;$group;$perms" >> $TEMPLATE_BASE.perms.tmp
 
     else
       if [ ! -e "$1/$file" ]; then
-        echo $BASENAME: warning: missing file $1/$file 
+        echo $BASENAME: warning: missing file $1/$file
       fi
     fi
 
+    cat $TEMPLATE_BASE.perms.tmp | sed '/^$/d' > $TEMPLATE_BASE.perms
+    rm -f $TEMPLATE_BASE.perms.tmp
+
   done
 
 }