2010-06-13 12:27:56 +00:00
|
|
|
#!/bin/sh
|
2010-06-09 15:31:18 +00:00
|
|
|
|
2010-06-20 15:56:04 +00:00
|
|
|
FALLBACK=\"0.11-svn\"
|
2010-06-09 15:31:18 +00:00
|
|
|
|
2010-06-14 13:01:13 +00:00
|
|
|
if [ $# -eq 0 ]; then
|
2010-06-09 15:31:18 +00:00
|
|
|
DIR=.
|
|
|
|
else
|
|
|
|
DIR=$1
|
|
|
|
fi
|
|
|
|
|
2010-06-14 13:01:13 +00:00
|
|
|
if [ -f version.h ]; then
|
2010-06-09 15:31:18 +00:00
|
|
|
REV_OLD=$(cat version.h | cut -d" " -f3)
|
|
|
|
else
|
2010-06-14 13:01:13 +00:00
|
|
|
REV_OLD=\"\"
|
2010-06-09 15:31:18 +00:00
|
|
|
fi
|
|
|
|
|
2010-06-14 13:01:13 +00:00
|
|
|
if [ -x "$(which svnversion 2>/dev/null)" -a -d "${DIR}/.svn" ] ; then
|
2010-06-09 15:31:18 +00:00
|
|
|
REV=\"$(svnversion -n ${DIR})\"
|
|
|
|
else
|
|
|
|
REV=${FALLBACK}
|
|
|
|
fi
|
|
|
|
|
2010-06-14 13:01:13 +00:00
|
|
|
if [ ${REV_OLD} != ${REV} ]; then
|
2010-06-09 15:31:18 +00:00
|
|
|
echo "Building new version.h"
|
2010-06-14 13:01:13 +00:00
|
|
|
echo "Rev_old: ${REV_OLD} Rev: ${REV}"
|
2010-06-13 09:51:52 +00:00
|
|
|
echo "#define VERSION_STRING ${REV}" > version.h
|
2010-06-09 15:31:18 +00:00
|
|
|
fi
|