]>
Commit | Line | Data |
---|---|---|
9b88fcef JH |
1 | #!/bin/sh |
2 | ||
3 | GVF=GIT-VERSION-FILE | |
181129d2 | 4 | DEF_VER=v1.1.GIT |
9b88fcef | 5 | |
181129d2 PA |
6 | # First try git-describe, then see if there is a version file |
7 | # (included in release tarballs), then default | |
8 | VN=$(git-describe --abbrev=4 HEAD 2>/dev/null) || | |
9 | VN=$(cat version) || | |
10 | VN="$DEF_VER" | |
11 | ||
12 | VN=$(expr "$VN" : v*'\(.*\)') | |
9b88fcef JH |
13 | if test -r $GVF |
14 | then | |
15 | VC=$(sed -e 's/^GIT_VERSION = //' <$GVF) | |
16 | else | |
17 | VC=unset | |
18 | fi | |
19 | test "$VN" = "$VC" || { | |
20 | echo >&2 "GIT_VERSION = $VN" | |
21 | echo "GIT_VERSION = $VN" >$GVF | |
22 | } | |
23 | ||
24 |