File update.sh of Package compiz
#!/bin/sh
oscmodule=$(basename $PWD)
if [ ! -d $oscmodule ]; then
echo "git checkout folder $oscmodule does not exist. Aborting..."
exit 1
fi
pushd $oscmodule; status=$(git pull); git submodule update; commitid=$(git log | head -n1); popd
if [ "$status" != "Already up-to-date." ]; then
if [ -n "$(head -n4 $oscmodule.changes | tail -n1 | grep commit)" ]; then
# The last changelog entry already was an automatic forward... let's not pullute too much.
sed -i 1,5d $oscmodule.changes
fi
# Setting the version in the .spec file to what the CMakeList.txt has defined
if [ -f "${oscmodule}/VERSION" ]; then
VERSION=$(cat ${oscmodule}/VERSION)
else
version_major=$(grep -P 'set \(COMPIZ_VERSION_MAJOR ([0-9])+\)' ${oscmodule}/CMakeLists.txt | tr -d "()a-zA-Z_ ")
version_minor=$(grep -P 'set \(COMPIZ_VERSION_MINOR ([0-9])+\)' ${oscmodule}/CMakeLists.txt | tr -d "()a-zA-Z_ ")
version_micro=$(grep -P 'set \(COMPIZ_VERSION_MICRO ([0-9])+\)' ${oscmodule}/CMakeLists.txt | tr -d "()a-zA-Z_ ")
VERSION=${version_major}.${version_minor}.${version_micro}
fi
if [ -n "$VERSION" ]; then
sed -i "s/Version:.*/Version: ${VERSION}/" *.spec
fi
tar cjf $oscmodule.tar.bz2 $oscmodule
osc vc -m "Forward to $commitid"
osc ci -m "Forward to $commitid" --skip-validation
fi