From: Simon Josefsson Date: Sat, 28 Dec 2024 18:46:30 +0000 (+0100) Subject: maintainer-makefile: Improve gnulib-version derivation. X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=552c0b06355a6720c8ce87ce305f42ed15a32d20;p=thirdparty%2Fgnulib.git maintainer-makefile: Improve gnulib-version derivation. * top/maint.mk (gnulib-version): Use git only when possible, falling back to GNULIB_REVISION or ChangeLog date otherwise. Use consistent full identifier. --- diff --git a/ChangeLog b/ChangeLog index 2eed147ec8..0de411cb2f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2024-12-28 Simon Josefsson + + maintainer-makefile: Improve gnulib-version derivation. + * top/maint.mk (gnulib-version): Use git only when possible, + falling back to GNULIB_REVISION or ChangeLog date otherwise. Use + consistent full identifier. + 2024-12-28 Simon Josefsson announce-gen: Support VPATH builds better. diff --git a/top/maint.mk b/top/maint.mk index b2baa02edf..0115d30f10 100644 --- a/top/maint.mk +++ b/top/maint.mk @@ -1515,8 +1515,15 @@ vc-diff-check: rel-files = $(DIST_ARCHIVES) -gnulib-version = $$(cd $(gnulib_dir) \ - && { git describe 2> /dev/null || git rev-parse --short=10 HEAD; } ) +gnulib-version ?= \ + $$(if test -e $(gnulib_dir)/.git; then \ + git -C $(gnulib_dir) rev-parse HEAD; \ + elif test -f $(srcdir)/bootstrap.conf; then \ + perl -lne '/^\s*GNULIB_REVISION=(\S+)/ and $$d=$$1;' \ + -e 'END{defined $$d and print $$d}' $(srcdir)/bootstrap.conf; \ + else \ + head -1 $(gnulib_dir)/ChangeLog | sed -e 's/ .*//;q '; \ + fi) bootstrap-tools ?= autoconf,automake,gnulib gpgv = $$(gpgv2 --version >/dev/null && echo gpgv2 || echo gpgv)