2009-07-24 18:16:31 +02:00
|
|
|
#! /bin/sh
|
|
|
|
#
|
|
|
|
a=$(svnversion -n ..)
|
|
|
|
[ -n "$a" ] || a=$(SubWCRev .. | tr -d '\n' | sed 's/[^0-9]*\([0-9]*\).*/\1/')
|
|
|
|
|
2009-07-25 09:09:52 +02:00
|
|
|
[ -f ../source/svnrev.c ] || touch ../source/svnrev.c
|
2009-07-24 18:16:31 +02:00
|
|
|
|
2009-07-25 09:09:52 +02:00
|
|
|
b=$(cat ../source/svnrev.c | tr -d '\n' | sed 's/[^0-9]*\([0-9]*\).*/\1/')
|
2009-07-24 18:16:31 +02:00
|
|
|
|
2009-07-24 18:23:00 +02:00
|
|
|
if [ "$a" != "$b" ]; then
|
2009-07-25 09:09:52 +02:00
|
|
|
echo '#define SVN_REV "'$a'"' > ../source/svnrev.c
|
|
|
|
echo '' >> ../source/svnrev.c
|
|
|
|
echo 'const char *GetRev()' >> ../source/svnrev.c
|
|
|
|
echo '{ ' >> ../source/svnrev.c
|
|
|
|
echo ' return SVN_REV;' >> ../source/svnrev.c
|
|
|
|
echo '}' >> ../source/svnrev.c
|
|
|
|
echo '' >> ../source/svnrev.c
|
|
|
|
echo 'svnrev changed' >&2
|
2009-07-24 18:16:31 +02:00
|
|
|
fi
|
|
|
|
echo $a
|