summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrick Ohly <patrick.ohly@intel.com>2014-02-15 23:09:49 +0100
committerPatrick Ohly <patrick.ohly@intel.com>2014-02-16 20:56:14 +0100
commit82bb12c5fcafbd094ce94f759d3690d702cd57f5 (patch)
tree0a62b667a555b30da34f703b50443aa9353a09db
parent969c7946064bd8625bc8e9b4ad167ad2770cd4fa (diff)
autotools: fix version check
The libsynthesis_3.4.0.47+syncevolution-1-3-99-7-20140203 tag accidentally matched the check for a non-exact-tag "git-describe" output (-<number of changes>-g<hash>). Therefore the actual tags weren't even checked. Reversing the check such that we look at tags ourselves and proceed with them if one matches avoids this problem.
-rwxr-xr-xbuild/gen-git-version.sh14
1 files changed, 7 insertions, 7 deletions
diff --git a/build/gen-git-version.sh b/build/gen-git-version.sh
index bd5c8d5e..4fe07613 100755
--- a/build/gen-git-version.sh
+++ b/build/gen-git-version.sh
@@ -48,17 +48,17 @@ checksource ()
# already a hash, abbreviate
hash=`echo $hash | sed -e 's/\(......\).*/\1/'`
fi
- # detect -<number of changes>-g<hash> suffix added when tag is older than HEAD
- if perl -e "exit !('$describe' =~ m/-[0-9]+-[0-9a-g]{8}\$/);"; then
- # remove suffix to get tag (doesn't matter if we do not pick
- # the most recent one)
- exact=
- tag=`echo $describe | sed -e 's/-[0123456789]*-g.*//'`
- else
+ if git show-ref --tags | grep -q $hash; then
# there is at least one tag matching HEAD;
# pick the most recent one (based on lexical sorting)
exact=1
tag=`git show-ref --tags | grep $hash | sort | tail -1 | sed -e 's;.*refs/tags/;;'`
+ else
+ # Detect -<number of changes>-g<hash> suffix added when tag is older than HEAD.
+ # Remove suffix to get tag (doesn't matter if we do not pick
+ # the most recent one).
+ exact=
+ tag=`echo $describe | sed -e 's/-[0123456789]*-g.*//'`
fi
simpletag=$tag
# Hyphens between numbers in the tag are dots in the version