File update.sh of Package trac-plugin-stats

#! /bin/bash

DIRNAME=tracstats
NAME=trac-plugin-stats

git clone --depth 1 --branch master https://github.com/mrjbq7/$DIRNAME $NAME
osc rm $NAME-*.tar.bz2
pushd $NAME
DATE=`date +"%Y%m%d"`
VERSION=`sed -n 's/ *version = .\([0-9.]\+\).,/\1/p' setup.py`
VER=${VERSION}_$DATE
ARC=$NAME-$VER.tar.bz2
echo -e ".gitattributes export-ignore\n.gitignore export-ignore" >.gitattributes
git add .gitattributes
git commit -m "get rid of .git*"
git archive --format=tar --prefix=$NAME-$VER/ master |bzip2 >../$ARC
popd
echo "New date $DATE, version $VERSION"
sed -i "s/\(Version: \+\).\+/\1$VER/;" $NAME.spec
rm -rf $NAME
osc add $ARC
openSUSE Build Service is sponsored by