summaryrefslogtreecommitdiff
path: root/GIT-VERSION-GEN
diff options
context:
space:
mode:
Diffstat (limited to 'GIT-VERSION-GEN')
-rwxr-xr-xGIT-VERSION-GEN10
1 files changed, 8 insertions, 2 deletions
diff --git a/GIT-VERSION-GEN b/GIT-VERSION-GEN
index 845b9dce6e..7763639a82 100755
--- a/GIT-VERSION-GEN
+++ b/GIT-VERSION-GEN
@@ -1,9 +1,15 @@
#!/bin/sh
GVF=GIT-VERSION-FILE
+DEF_VER=v1.1.GIT
-VN=$(git-describe --abbrev=4 HEAD 2>/dev/null) || VN=v1.0.GIT
-VN=$(expr "$VN" : v'\(.*\)')
+# First try git-describe, then see if there is a version file
+# (included in release tarballs), then default
+VN=$(git-describe --abbrev=4 HEAD 2>/dev/null) ||
+VN=$(cat version) ||
+VN="$DEF_VER"
+
+VN=$(expr "$VN" : v*'\(.*\)')
if test -r $GVF
then
VC=$(sed -e 's/^GIT_VERSION = //' <$GVF)