# HG changeset patch # User "Yann E. MORIN" # Date 1321205076 -3600 # Node ID 3cd375ecdd7213104577bbd70863fa35f387bb93 # Parent d77d04661cd9af11afea5d62e447667bdaeee4c7 configure: compute a simpler version string Compute a simpler, yet still completely descriptive, version string. Signed-off-by: "Yann E. MORIN" diff -r d77d04661cd9 -r 3cd375ecdd72 configure --- a/configure Sun Nov 13 17:48:17 2011 +0100 +++ b/configure Sun Nov 13 18:24:36 2011 +0100 @@ -550,21 +550,19 @@ 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" #---------------------------------------------------------------------