mirror of
https://github.com/RsyncProject/rsync.git
synced 2026-03-29 19:51:16 -04:00
21 lines
495 B
Bash
Executable File
21 lines
495 B
Bash
Executable File
#!/bin/sh
|
|
|
|
srcdir=`dirname $0`
|
|
|
|
if [ ! -f git-version.h ]; then
|
|
touch git-version.h
|
|
fi
|
|
|
|
if [ -e "$srcdir/.git" ]; then
|
|
gitver=`git describe --abbrev=8 2>/dev/null | sed -n '/^v3\.[0-9][0-9]*\.[0-9][0-9]*\(-\|$\)/p'`
|
|
if [ -n "$gitver" ]; 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
|