From: Wayne Davison Date: Tue, 16 Aug 2022 15:38:58 +0000 (-0700) Subject: Another mkgitver tweak & mention it in NEWS. X-Git-Tag: v3.2.6~21 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=2895b65f53f3a5b54026a1761d7bb4e779bebf3b;p=thirdparty%2Frsync.git Another mkgitver tweak & mention it in NEWS. --- diff --git a/NEWS.md b/NEWS.md index 8b9624a2..2196c33c 100644 --- a/NEWS.md +++ b/NEWS.md @@ -8,7 +8,14 @@ args. - Fixed a bug in the internal MD4 checksum code that could cause the digest - to be incorrect part of the time (the openssl version was/is fine). + to be sporadically incorrect (the openssl version was/is fine). + +### PACKAGING RELATED: + +- The mkgitver script now makes sure that a `.git` dir/file is in the top-level + source dir before calling `git describe`. It also runs a basic check on the + version value. This should avoid using an unrelated git description for + rsync's version. ------------------------------------------------------------------------------ diff --git a/mkgitver b/mkgitver index 43156c65..fe8a3d15 100755 --- a/mkgitver +++ b/mkgitver @@ -2,16 +2,13 @@ srcdir=`dirname $0` -if [ -e "$srcdir/.git" ]; then - gitver=`git describe --abbrev=8 2>/dev/null` -fi - if [ ! -f git-version.h ]; then touch git-version.h fi -case "$gitver" in - *.*) +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" @@ -19,5 +16,5 @@ case "$gitver" in else rm git-version.h.new fi - ;; -esac + fi +fi