summaryrefslogtreecommitdiffstats
path: root/mkgitver
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 16:14:31 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 16:14:31 +0000
commit2d5707c7479eacb3b1ad98e01b53f56a88f8fb78 (patch)
treed9c334e83692851c02e3e1b8e65570c97bc82481 /mkgitver
parentInitial commit. (diff)
downloadrsync-2d5707c7479eacb3b1ad98e01b53f56a88f8fb78.tar.xz
rsync-2d5707c7479eacb3b1ad98e01b53f56a88f8fb78.zip
Adding upstream version 3.2.7.upstream/3.2.7
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'mkgitver')
-rwxr-xr-xmkgitver22
1 files changed, 22 insertions, 0 deletions
diff --git a/mkgitver b/mkgitver
new file mode 100755
index 0000000..0102b08
--- /dev/null
+++ b/mkgitver
@@ -0,0 +1,22 @@
+#!/bin/sh
+
+srcdir=`dirname $0`
+
+if [ ! -f git-version.h ]; then
+ touch git-version.h
+fi
+
+if test -d "$srcdir/.git" || test -f "$srcdir/.git"; then
+ gitver=`git describe --abbrev=8 2>/dev/null`
+ # NOTE: I'm avoiding "|" in sed since I'm not sure if sed -r is portable and "\|" fails on some OSes.
+ verchk=`echo "$gitver-" | sed -n '/^v3\.[0-9][0-9]*\.[0-9][0-9]*\(pre[0-9]*\)*-/p'`
+ if [ -n "$verchk" ]; then
+ echo "#define RSYNC_GITVER \"$gitver\"" >git-version.h.new
+ if ! diff git-version.h.new git-version.h >/dev/null; then
+ echo "Updating git-version.h"
+ mv git-version.h.new git-version.h
+ else
+ rm git-version.h.new
+ fi
+ fi
+fi