build: Stricter git tag version parsing 32/33832/3
authorNick Brown <nickbroon@gmail.com>
Mon, 27 Sep 2021 11:11:23 +0000 (12:11 +0100)
committerDamjan Marion <dmarion@me.com>
Mon, 27 Sep 2021 14:34:46 +0000 (14:34 +0000)
Only consider git tags that begin with 'v', as these are far more likely
to be vpp version tags, and thus parsed by the version script properly.

This needed when working with git clone to which additional tags may
have been added.

eg tags like:

upstream/21.06_rc0+20210622
debian/21.06+20210811-1myvendor2

should be ingored, as they will not be parsed correctly.

Type: make
Change-Id: I7a6d185acd029335abaea5a9dac48839f1397135
Signed-off-by: Nick Brown <nickbroon@gmail.com>
src/scripts/version

index 455ab76..f9f3d21 100755 (executable)
@@ -20,7 +20,7 @@ cd "$path"
 if [ -f .version ]; then
     vstring=$(cat .version)
 else
-    vstring=$(git describe --long)
+    vstring=$(git describe --long --match "v*")
     if [ $? != 0 ]; then
       exit 1
     fi