10 # First see if there is a version file (included in release tarballs),
11 # then try git-describe, then default.
14 VN
=$
(cat version
) || VN
="$DEF_VER"
15 elif test -d .git
-o -f .git
&&
16 VN
=$
(git describe
--abbrev=4 HEAD
2>/dev
/null
) &&
20 git update-index
-q --refresh
21 test -z "$(git diff-index --name-only HEAD --)" ||
25 VN
=$
(echo "$VN" |
sed -e 's/-/./g');
30 VN
=$
(expr "$VN" : v
*'\(.*\)')
34 VC
=$
(sed -e 's/^GIT_VERSION = //' <$GVF)
38 test "$VN" = "$VC" ||
{
39 echo >&2 "GIT_VERSION = $VN"
40 echo "GIT_VERSION = $VN" >$GVF