8 # First see if there is a version file (included in release tarballs),
9 # then try git-describe, then default.
12 VN
=$
(cat version
) || VN
="$DEF_VER"
13 elif test -d .git
-o -f .git
&&
14 VN
=$
(git describe
--tags --match "[0-9]*" --abbrev=4 HEAD
2>/dev
/null
) &&
18 git update-index
-q --refresh
19 test -z "$(git diff-index --name-only HEAD --)" || VN
="$VN-dirty"
22 VN
=$
(echo "$VN" |
sed -e 's/-/./g');
28 VN
=$
(expr "$VN" : v
*'\(.*\)')
32 VC
=$
(sed -e 's/^IPTRAF_VERSION = //' <$GVF)
36 test "$VN" = "$VC" ||
{
37 echo >&2 "IPTRAF_VERSION = $VN"
38 echo "IPTRAF_VERSION = $VN" >$GVF