changeset 32891:744741d2607a

Do not run svn or otherwise try to extract the svn revision when we have a VERSION file we'll be using anyway.
author reimar
date Sun, 27 Feb 2011 15:14:23 +0000
parents 96340f2c8c17
children b5f21d533644
files version.sh
diffstat 1 files changed, 6 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/version.sh	Sun Feb 27 14:32:24 2011 +0000
+++ b/version.sh	Sun Feb 27 15:14:23 2011 +0000
@@ -2,6 +2,10 @@
 
 test "$1" && extra="-$1"
 
+# releases extract the version number from the VERSION file
+version=$(cat VERSION 2> /dev/null)
+
+if test -z $version ; then
 # Extract revision number from file used by daily tarball snapshots
 # or from the places different Subversion versions have it.
 svn_revision=$(cat snapshot_version 2> /dev/null)
@@ -10,10 +14,8 @@
 test $svn_revision || svn_revision=$(sed -n -e '/^dir$/{n;p;q;}' .svn/entries 2>/dev/null)
 test $svn_revision && svn_revision=SVN-r$svn_revision
 test $svn_revision || svn_revision=UNKNOWN
-
-# releases extract the version number from the VERSION file
-version=$(cat VERSION 2> /dev/null)
-test $version || version=$svn_revision
+version=$svn_revision
+fi
 
 NEW_REVISION="#define VERSION \"${version}${extra}\""
 OLD_REVISION=$(head -n 1 version.h 2> /dev/null)