···9090#
9191if [ -n "$1" ]; then TOP=$1; else TOP=..; fi
92929393-# If the VERSIONFILE exisits we use that
9494-VERSIONFILE=docs/VERSION
9595-if [ -r $TOP/$VERSIONFILE ]; then VER=`cat $TOP/$VERSIONFILE`;
9696-else
9797- # Ok, we need to derive it from the Version Control system
9898- if [ -d "$TOP/.git" ]; then
9999- VER=`gitversion $TOP`
100100- elif [ -d "$TOP/.bzr" ]; then
101101- VER=`bzrversion $TOP`
9393+# setting VERSION var on commandline has precedence
9494+if [ -z $VERSION ]; then
9595+ # If the VERSIONFILE exisits we use that
9696+ VERSIONFILE=docs/VERSION
9797+ if [ -r $TOP/$VERSIONFILE ]; then VER=`cat $TOP/$VERSIONFILE`;
10298 else
103103- VER=`svnversion_safe $TOP`;
104104- if [ "$VER" = "unknown" ]; then
105105- # try getting it from a subdir to test if perhaps they are symlinked
106106- # from the root
107107- VER=`svnversion_safe $TOP/tools`;
108108- fi
9999+ # Ok, we need to derive it from the Version Control system
100100+ if [ -d "$TOP/.git" ]; then
101101+ VER=`gitversion $TOP`
102102+ elif [ -d "$TOP/.bzr" ]; then
103103+ VER=`bzrversion $TOP`
104104+ else
105105+ VER=`svnversion_safe $TOP`;
106106+ if [ "$VER" = "unknown" ]; then
107107+ # try getting it from a subdir to test if perhaps they are symlinked
108108+ # from the root
109109+ VER=`svnversion_safe $TOP/tools`;
110110+ fi
111111+ fi
109112 fi
110110-fi
111113VERSION=$VER-`date -u +%y%m%d`
114114+fi
112115echo $VERSION
113116