5 if [ ! -f git-version.h
]; then
9 if test -d "$srcdir/.git" ||
test -f "$srcdir/.git"; then
10 gitver
=`git describe --abbrev=8 2>/dev/null`
11 # NOTE: I'm avoiding "|" in sed since I'm not sure if sed -r is portable and "\|" fails on some OSes.
12 verchk
=`echo "$gitver-" | sed -n '/^v3\.[0-9][0-9]*\.[0-9][0-9]*\(pre[0-9]*\)*-/p'`
13 if [ -n "$verchk" ]; then
14 echo "#define RSYNC_GITVER \"$gitver\"" >git-version.h.new
15 if ! diff git-version.h.new git-version.h
>/dev
/null
; then
16 echo "Updating git-version.h"
17 mv git-version.h.new git-version.h