summaryrefslogtreecommitdiff
path: root/configure
diff options
context:
space:
mode:
authorYann E. MORIN" <yann.morin.1998@anciens.enib.fr>2008-02-17 22:58:57 (GMT)
committerYann E. MORIN" <yann.morin.1998@anciens.enib.fr>2008-02-17 22:58:57 (GMT)
commitefa83fdf6e16f235efdd8d5c1aaa6edb307ff6a1 (patch)
tree596936a133ad9afb310dbd4e5926876bfc8542da /configure
parent20eeb8e122866362827acbac8665adee4c28c95c (diff)
When installing SVN snapshots, include the branch and revision in the version number.
In case some random snapshot is installed and used for production, then this will ease rewinding.
Diffstat (limited to 'configure')
-rwxr-xr-xconfigure15
1 files changed, 15 insertions, 0 deletions
diff --git a/configure b/configure
index d72c50d..195334c 100755
--- a/configure
+++ b/configure
@@ -121,6 +121,21 @@ fi
#---------------------------------------------------------------------
# Some sanity checks, now
+# If this version is a svn snapshot, try to get the revision number
+# If we can't get the revision number, use date
+case "${VERSION}" in
+ *+svn)
+ REVISION=$(LANG=C svn info 2>/dev/null |egrep 'Revision: ' |cut -d ' ' -f 2-)
+ if [ -n "${REVISION}" ]; then
+ URL=$(LANG=C svn info 2>/dev/null |egrep 'URL: ' |cut -d ' ' -f 2-)
+ ROOT=$(LANG=C svn info 2>/dev/null |egrep 'Repository Root: ' |cut -d ' ' -f 3-)
+ VERSION="${VERSION}:${URL#${ROOT}}@${REVISION}"
+ else
+ VERSION="${VERSION}:unknown@$(date +%Y%m%d.%H%M%S)"
+ fi
+ ;;
+esac
+
# Check bash is present, and at least version 3.0
[ -x /bin/bash ] || do_error "bash 3.0 or above was not found in /bin/bash"
bash_version=$(/bin/bash -c 'echo ${BASH_VERSION}')