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
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
}