Fix a return value from sync_eventlog_params() (patch from Volker)
[ira/wip.git] / packaging / bin / update-pkginfo
index fab56daebf880acac2d50c38e09034010f531c6c..020c773da08a80e4a439e986b0d5a978cb5e2635 100755 (executable)
@@ -2,14 +2,27 @@
 
 VERSION=$1
 RELEASE=$2
+REVISION=$3
 
-for f in */*/*.tmpl; do
-       f2=`echo $f | sed s/.tmpl//g`
-       echo $f2
-       sed -e s/PVERSION/$VERSION/g -e s/PRELEASE/$RELEASE/g < $f > $f2
-done
-for f in */*.tmpl; do
-       f2=`echo $f | sed s/.tmpl//g`
-       echo $f2
-       sed -e s/PVERSION/$VERSION/g -e s/PRELEASE/$RELEASE/g < $f > $f2
+if [ "x${REVISION}" = "x" ]; then
+       RPMREVISION=""
+else
+       RPMREVISION=".${REVISION}"
+fi
+
+if [ $# -ne 3 ]; then
+    echo Usage: update-pkginfo VERSION RELEASE REVISION
+    exit 1
+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
+        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/${RPMREVISION}/g < $f > $f2
 done
+