3 # This is from the Git repository (GIT-VERSION-GEN with modifications)
14 # First see if there is a version file (included in release tarballs),
15 # then try git-describe, then default.
16 if test -f $SRC_ROOT/version
18 VN
=`cat $SRC_ROOT/version` || VN
="$DEF_VER"
19 elif test -d $SRC_ROOT/.git
-o -f $SRC_ROOT/.git
&&
20 VN
=`cd $SRC_ROOT; git describe --abbrev=4 HEAD 2>/dev/null` &&
24 git update-index
-q --refresh
25 test -z "`git diff-index --name-only HEAD --`" ||
29 VN
=`echo "$VN" | sed -e 's/^release-//' | sed -e 's/-/./g'`;
34 VN
=`expr "$VN" : v*'\(.*\)'`
38 VC
=`sed -e 's/^NP_VERSION = //' <$NPVF`
42 test "$VN" = "$VC" ||
{
43 echo >&2 "NP_VERSION = $VN"
44 echo "NP_VERSION = $VN" >$NPVF