summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYann E. MORIN" <yann.morin.1998@anciens.enib.fr>2011-11-13 17:24:36 (GMT)
committerYann E. MORIN" <yann.morin.1998@anciens.enib.fr>2011-11-13 17:24:36 (GMT)
commit66cf16ec46cfebfb67e1a0084fc36b658a62c936 (patch)
tree1c416bebc606a4cc6c75c5506d68d6099ecb4918
parenta37a5856371a357583a7ee9e9d05b945eba555f1 (diff)
configure: compute a simpler version string
Compute a simpler, yet still completely descriptive, version string. Signed-off-by: "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
-rwxr-xr-xconfigure20
1 files changed, 9 insertions, 11 deletions
diff --git a/configure b/configure
index 76194b9..a23f994 100755
--- a/configure
+++ b/configure
@@ -550,21 +550,19 @@ if [ -n "${V}" ]; then
else
case "${VERSION}" in
*+hg|hg)
- REVISION="$( hg id -n 2>/dev/null || true )"
- case "${REVISION}" in
- "")
- VERSION="${VERSION}_unknown@$( date +%Y%m%d.%H%M%S )";;
- *)
- VERSION="${VERSION}_$( hg id -b )@${REVISION%%+}_$( hg id -i )"
- ;;
- esac
- # Arrange to have no / in the directory name, no need to create an
- # arbitrarily deep directory structure
- VERSION="$( printf "${VERSION}\n" |"${sed}" -r -e 's|/+|_|g;' )"
+ rev_id="$( hg log -r . --template '{branch}:{node|short}\n' \
+ 2>/dev/null \
+ || true \
+ )"
+ VERSION="${VERSION}@${rev_id:-unknown:$( date +%Y%m%d.%H%M%S )}"
;;
esac
fi
+# Arrange to have no / in the directory name, no need to create an
+# arbitrarily deep directory structure
+VERSION="$( printf "${VERSION}" |"${sed}" -r -e 's:/+:_:g;' )"
+
printf "${VERSION}\n"
#---------------------------------------------------------------------