libproxy/update-from-svn.sh
OBS User autobuild 3c96a02508 Accepting request 46523 from GNOME:Factory
Copy from GNOME:Factory/libproxy based on submit request 46523 from user dimstar

OBS-URL: https://build.opensuse.org/request/show/46523
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/libproxy?expand=0&rev=22
2010-09-03 11:57:22 +00:00

29 lines
743 B
Bash

#!/bin/sh
MODULE=$(basename $(pwd))
if [ ! -x /usr/bin/svn ]; then
echo "subversion is missing - aborting"
return 1
fi
if [ ! -d $MODULE ]; then
echo "Base directory of $MODULE checkout is missing - aborting"
exit 2
fi
pushd $MODULE
svn update
VERSION=$(grep "version" $MODULE/CMakeLists.txt | awk -F'(' '{print $2}' | awk '{print $1+0"."$2+0"."$3+0}')
SVNREV=$(svn info | awk '/Revision:/ { print $2 }')
popd
# Adjust the version information and svn rev in the spec file to what we get from the svn checkout.
sed -i "s/Version:.*/Version: ${VERSION}.svn.$SVNREV/" $MODULE.spec
tar cjf $MODULE.tar.bz2 $MODULE
[ -f pre_checkin.sh ] && sh pre_checkin.sh
osc ci -m "Update to ${VERSION/git/svn.$SVNREV}" --skip-validation