From: Wayne Davison Date: Fri, 1 Oct 2021 21:13:00 +0000 (-0700) Subject: Always run `mkgitver` prior to a build X-Git-Tag: v3.2.4pre1~48 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=bff084c10a90a77cf21cccd89e58b5efd5ed8d43;p=thirdparty%2Frsync.git Always run `mkgitver` prior to a build Some hosts were not running `mkgitver` when they should, so tweak the script to only update the timestamp when the file's data changes and then always run the script when performing a build. --- diff --git a/Makefile.in b/Makefile.in index 0b5973b1..c4c00e96 100644 --- a/Makefile.in +++ b/Makefile.in @@ -131,12 +131,12 @@ rounding.h: rounding.c rsync.h proto.h fi @rm -f rounding.out -# While $(wildcard ...) is a GNU make idiom, at least other makes should just turn it into an -# empty string (we need something that will vanish if we're not building a git checkout). -# If you want an updated git version w/o GNU make, remove git-version.h after a pull. -git-version.h: mkgitver $(wildcard $(srcdir)/.git/logs/HEAD) +git-version.h: ALWAYS_RUN $(srcdir)/mkgitver +.PHONY: ALWAYS_RUN +ALWAYS_RUN: + simd-checksum-x86_64.o: simd-checksum-x86_64.cpp @$(srcdir)/cmd-or-msg disable-simd $(CXX) -I. $(CXXFLAGS) $(CPPFLAGS) -c -o $@ $(srcdir)/simd-checksum-x86_64.cpp diff --git a/mkgitver b/mkgitver index 8e76774c..49aa150b 100755 --- a/mkgitver +++ b/mkgitver @@ -3,12 +3,18 @@ srcdir=`dirname $0` gitver=`git describe --abbrev=8 2>/dev/null` +if [ ! -f git-version.h ]; then + touch git-version.h +fi + case "$gitver" in *.*) - echo "#define RSYNC_GITVER \"$gitver\"" >git-version.h - ;; - *) - # We either create an empty file or update the time on what the user gave us. - touch git-version.h + 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 ;; esac