me
/
guix
Archived
1
0
Fork 0

maint: Use reproducible Git timestamp for POT-Creation-Date.

* po/doc/local.mk (%D%/%.pot): Replace POT-Creation-Date using timestamp from
Git.
(%D%/guix-manual.pot): Likewise.

Change-Id: I1b7f8cc147084c1804deb7be9d36e5eeda2599cb
master
Janneke Nieuwenhuizen 2024-04-03 08:08:12 +02:00
parent 6c63c36677
commit ecf0e22dcf
No known key found for this signature in database
GPG Key ID: F3C1A0D9C1D65273
1 changed files with 12 additions and 4 deletions

View File

@ -1,6 +1,7 @@
# GNU Guix --- Functional package management for GNU # GNU Guix --- Functional package management for GNU
# Copyright © 2018 Julien Lepiller <julien@lepiller.eu> # Copyright © 2018 Julien Lepiller <julien@lepiller.eu>
# Copyright © 2021 Maxim Cournoyer <maxim.cournoyer@gmail.com> # Copyright © 2021 Maxim Cournoyer <maxim.cournoyer@gmail.com>
# Copyright © 2024 Janneke Nieuwenhuizen <janneke@gnu.org>
# #
# This file is part of GNU Guix. # This file is part of GNU Guix.
# #
@ -45,11 +46,18 @@ POT_OPTIONS = \
%D%/%.pot: $(srcdir)/doc/%.texi %D%/%.pot: $(srcdir)/doc/%.texi
$(AM_V_PO4A)$(PO4A_UPDATEPO) -M UTF-8 -f texinfo -m "$<" \ $(AM_V_PO4A)$(PO4A_UPDATEPO) -M UTF-8 -f texinfo -m "$<" \
-p "$@" $(POT_OPTIONS) && \ -p "$@-t" $(POT_OPTIONS)
touch $@ date="$$(git log --pretty=format:%ci -n 1 -- $< 2>/dev/null \
|| echo $(SOURCE_DATE_EPOCH))" \
sed -ri -e "s,^(.POT-Creation-Date: )[^\]*,\1$$date," "$@-t"
mv "$@-t" "$@"
%D%/guix-manual.pot: %D%/guix.pot %D%/contributing.pot %D%/guix-manual.pot: %D%/guix.pot %D%/contributing.pot
msgcat $^ > $@ msgcat $^ > "$@-t"
date="$$(git log --pretty=format:%ci -n 1 -- $< 2>/dev/null \
|| echo $(SOURCE_DATE_EPOCH))" \
sed -ri "s,^(.POT-Creation-Date: )[^\]*,\1$$date," "$@-t"
mv "$@-t" "$@"
doc-pot-update: %D%/guix-manual.pot %D%/guix-cookbook.pot doc-pot-update: %D%/guix-manual.pot %D%/guix-cookbook.pot
.PHONY: doc-pot-update .PHONY: doc-pot-update