summaryrefslogtreecommitdiff
path: root/packaging/bin/update-pkginfo
blob: 7587f689d910ff148946204ef8a0d206a987a36b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#!/bin/bash

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
fi

DIRNAME=$(dirname $0)
TOPDIR=${DIRNAME}/../../
PACKAGINGDIR=${TOPDIR}/packaging

pushd ${PACKAGINGDIR} > /dev/null 2>&1
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/${RPMREVISION}/g < $f > $f2
done
popd > /dev/null 2>&1