From 4673bf1676a521d497cd362b710c35387f1c5dec Mon Sep 17 00:00:00 2001 From: "G.raud" Date: Sat, 26 Apr 2014 20:01:56 +0200 Subject: [PATCH] version.sh: try to get the version from release/* tags first --- version.sh | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/version.sh b/version.sh index 39f661e..103ed0d 100755 --- a/version.sh +++ b/version.sh @@ -15,6 +15,20 @@ NL=' # name, then use the default. if test -d .git || test -f .git && + VN=$(git describe --abbrev=7 --match "release/*" --tags HEAD 2>/dev/null) && + case $VN in + *$NL*) + false ;; + release/*) + git update-index -q --refresh + test -z "$(git diff-index --name-only HEAD --)" || + VN="$VN.dirty" ;; + esac +then + VN=$(echo "$VN" | sed -e 's#^[rR][eE][lL][a-zA-Z]\{0,\}/##' -e 's/-/+/' -e 's/-/_/') + # +_g.dirty +elif + test -d .git || test -f .git && VN=$(git describe --abbrev=7 --match "version/*" --tags HEAD --always 2>/dev/null) && case $VN in *$NL*) -- 2.11.4.GIT