6 svn info . > conftemp.svn
11 if test -d .svn && ( grep Revision: conftemp.svn > /dev/null; ); then
12 #if grep Revision: conftemp.svn > /dev/null ; then
13 SVN_REV=`grep Revision: conftemp.svn|cut -d: -f 2|cut -c2-`
14 SVN_URL=`grep URL: conftemp.svn|cut -d: -f 2-|cut -c2-`
15 SVN_PATH=`grep URL: conftemp.svn|cut -d "/" -f 7-`
16 SVN_TYPE=`echo ${SVN_PATH} |cut -d "/" -f 1`
17 SVN_BRANCH=`echo "${SVN_PATH}"| cut -d "/" -f 2`
18 url=`grep URL: conftemp.svn|cut -d: -f 2-|cut -c2-`
22 GIT_SHA1=`git rev-parse HEAD | cut -c -8 `
25 if test -f FULL_VERSION; then
26 FULL_VERSION_FILE="FULL_VERSION"
27 OLD_VERSION=`cat $FULL_VERSION_FILE`
28 else if test -n "$srcdir" -a -f $srcdir/FULL_VERSION; then
29 FULL_VERSION_FILE="$srcdir/FULL_VERSION"
30 OLD_VERSION=`cat $FULL_VERSION_FILE`
32 FULL_VERSION_FILE="FULL_VERSION"
37 if test -n "$srcdir"; then
38 VERSION_FILE="$srcdir/VERSION"
40 VERSION_FILE="VERSION"
42 VERSION=`cat $VERSION_FILE`
44 if test -n "$SVN_REV"; then
45 if test "${SVN_TYPE}" = "branches"; then
46 VERSION=${VERSION}.svn.${SVN_REV}
47 else if test "${SVN_TYPE}" = "trunk"; then
48 VERSION=${VERSION}.svn.${SVN_REV}
50 RC=`echo "${SVN_BRANCH}"| grep "rc"`
51 if test -n "$RC"; then
52 VERSION=`echo "${SVN_BRANCH}"| sed 's/[^0-9]*// ; s/[_.]//g'`
53 VERSION=`echo ${VERSION}| sed 's/^\([0-9]\)\([0-9]\)\([0-9]\)/\1.\2.\3/'`
58 else if test -n "$GIT_SHA1"; then
59 VERSION=${VERSION}".git."${GIT_SHA1}
61 else if test -n "$OLD_VERSION"; then
67 if test "$VERSION" != "$OLD_VERSION" -o $VERSION_FILE -nt FULL_VERSION; then
68 echo "$VERSION" > FULL_VERSION