packaging: use "find" instead of "du" to find files... :-)
[kai/samba.git] / packaging / bin / update-pkginfo
index bcd383e43406ae9f282a9c2128d11c14ba503357..9d8006aa581ba5686ef8960693a045a032817074 100755 (executable)
@@ -4,6 +4,12 @@ VERSION=$1
 RELEASE=$2
 REVISION=$3
 
+if [ "x${REVISION}" = "x" ]; then
+       RPMREVISION=""
+else
+       RPMREVISION=".${REVISION}"
+fi
+
 if [ $# -ne 3 ]; then
     echo Usage: update-pkginfo VERSION RELEASE REVISION
     exit 1
@@ -11,12 +17,12 @@ fi
 # PREV=`echo ${REVISION} | sed 's/[^0-9]//g'`
 # PREV="."`echo ${REVISION} | sed 's/[0-9]//g'`".${PREV}"
 
-for f in `du -a | awk '{print $2}' | grep \.tmpl$`; do
+for f in `find . -type f -name "*.tmpl"`; do
         f2=`echo $f | sed s/.tmpl//g`
         echo $f2
         sed -e s/PVERSION/$VERSION/g \
                -e s/PRELEASE/$RELEASE/g \
                -e s/PREVISION/${REVISION}/g \
-               -e s/PRPMREV/.${REVISION}/g < $f > $f2
+               -e s/PRPMREV/${RPMREVISION}/g < $f > $f2
 done