3 # This is from the Git repository (GIT-VERSION-GEN with modifications)
14 # First try git-describe, then svn info, then default.
15 if test -d $SRC_ROOT/.git
-o -f $SRC_ROOT/.git
&&
16 VN
=`cd $SRC_ROOT; 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/^release-//' | sed -e 's/-/./g'`;
26 elif test -d $SRC_ROOT/.svn
-o -f $SRC_ROOT/.svn
&&
27 VN
=`cd $SRC_ROOT; svn info 2>/dev/null | grep '^Revision'` &&
31 VN
=`echo $VN | awk '{print $NF}'`
32 test "`svn status 2>/dev/null | grep '^[AMD]' | wc -l | tr -d ' '`" = 0 ||
36 VN
=`echo "trunk.$VN" | sed -e 's/-/./g'`;
41 VN
=`expr "$VN" : v*'\(.*\)'`
45 VC
=`sed -e 's/^NP_VERSION = //' <$NPVF`
49 test "$VN" = "$VC" ||
{
50 echo >&2 "NP_VERSION = $VN"
51 echo "NP_VERSION = $VN" >$NPVF