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 git diff-index
--quiet HEAD || VN
="$VN-dirty" ;;
22 VN
=$
(echo "$VN" |
sed -e 's/-/./g');
27 VN
=$
(expr "$VN" : v
*'\(.*\)')
31 VC
=$
(sed -e 's/^GIT_VERSION = //' <$GVF)
35 test "$VN" = "$VC" ||
{
36 echo >&2 "GIT_VERSION = $VN"
37 echo "GIT_VERSION = $VN" >$GVF