build: Generate reproducible doc/version.texi.

* build-aux/GNUmakefile.in (doc/version.texi): Use timestamp from git.
This commit is contained in:
Janneke Nieuwenhuizen 2023-09-09 14:04:20 +02:00
parent 8371544c6f
commit 61956fb14c
1 changed files with 8 additions and 4 deletions

View File

@ -170,10 +170,14 @@ 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"); \
(set `LANG=' \
echo "@set UPDATED $$dmy"; \
echo "@set UPDATED-MONTH $$my"; \
echo "@set EDITION $(VERSION)"; \
echo "@set VERSION $(VERSION)") > $@
doc: doc/version.texi