r15163: packaging updates for RHEL/Fedora and break out 'pre' tag to the RPM release...
[ira/wip.git] / packaging / bin / update-pkginfo
1 #!/bin/bash
2
3 VERSION=$1
4 RELEASE=$2
5 REVISION=$3
6
7 if [ $# -ne 3 ]; then
8     echo Usage: update-pkginfo VERSION RELEASE REVISION
9     exit 1
10 fi
11 # PREV=`echo ${REVISION} | sed 's/[^0-9]//g'`
12 # PREV="."`echo ${REVISION} | sed 's/[0-9]//g'`".${PREV}"
13
14 for f in `du -a | awk '{print $2}' | grep \.tmpl$`; do
15         f2=`echo $f | sed s/.tmpl//g`
16         echo $f2
17         sed -e s/PVERSION/$VERSION/g \
18                 -e s/PRELEASE/$RELEASE/g \
19                 -e s/PREVISION/${REVISION}/g \
20                 -e s/PRPMREV/.${REVISION}/g < $f > $f2
21 done
22