9 # First see if there is a version file (included in release tarballs),
10 # then try git-describe, then default.
13 VN=$(cat version) || VN="$DEF_VER"
15 VN=$(git describe --abbrev=4 HEAD 2>/dev/null) &&
19 test -z "$(git diff-index --name-only HEAD)" ||
23 VN=$(echo "$VN" | sed -e 's/-/./g');
28 VN=$(expr "$VN" : v*'\(.*\)')
32 VC=$(sed -e 's/^GIT_VERSION = //' <$GVF)
36 test "$VN" = "$VC" || {
37 echo >&2 "GIT_VERSION = $VN"
38 echo "GIT_VERSION = $VN" >$GVF