From 002dc6253a6472ec8a63d1826e1d1880521cbe94 Mon Sep 17 00:00:00 2001 From: Janneke Nieuwenhuizen Date: Sat, 9 Sep 2023 14:04:20 +0200 Subject: [PATCH] build: Generate reproducible doc/version.texi. * build-aux/GNUmakefile.in (doc/version.texi): Use timestamp from git. --- build-aux/GNUmakefile.in | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/build-aux/GNUmakefile.in b/build-aux/GNUmakefile.in index c5ede91e..7af36148 100644 --- a/build-aux/GNUmakefile.in +++ b/build-aux/GNUmakefile.in @@ -170,10 +170,13 @@ uninstall: doc/version.texi: ${srcdest}doc/mes.texi GNUmakefile @mkdir -p $(@D) - (set `LANG= date -r $< +'%d %B %Y'`;\ - echo "@set UPDATED $$1 $$2 $$3"; \ - echo "@set UPDATED-MONTH $$2 $$3"; \ - echo "@set EDITION $(VERSION)"; \ + timestamp=$$({ git log --pretty=format:%ct -- $< \ + || date +%s -r $<; } \ + | sort -n -r | head -n 1); \ + dmy=$$(date --date="@$$timestamp" "+%-d %B %Y"); \ + (echo "@set UPDATED $$dmy"; \ + echo "@set UPDATED-MONTH $$my"; \ + echo "@set EDITION $(VERSION)"; \ echo "@set VERSION $(VERSION)") > $@ doc: doc/version.texi