blob: c514460f8caaec8f5db0e1cadce21231bdf189da [file] [log] [blame]
From a7eae39099ef4c0d9e515697b6e60d42b181b0cb Mon Sep 17 00:00:00 2001
From: Anders Kaseorg <andersk@mit.edu>
Date: Wed, 30 Nov 2016 22:21:15 -0500
Subject: Normalize generated asciidoc timestamps with SOURCE_DATE_EPOCH
This is needed to pass the Debian build reproducibility test
(https://wiki.debian.org/ReproducibleBuilds/TimestampsProposal).
Signed-off-by: Anders Kaseorg <andersk@mit.edu>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
---
Documentation/Makefile | 7 +++++--
Documentation/technical/api-index.sh | 4 ++++
2 files changed, 9 insertions(+), 2 deletions(-)
diff --git a/Documentation/Makefile b/Documentation/Makefile
index 95f6a321f2..642cd6cf8a 100644
--- a/Documentation/Makefile
+++ b/Documentation/Makefile
@@ -414,6 +414,7 @@ $(patsubst %.txt,%.texi,$(MAN_TXT)): %.texi : %.xml
howto-index.txt: howto-index.sh $(wildcard howto/*.txt)
$(QUIET_GEN)$(RM) $@+ $@ && \
'$(SHELL_PATH_SQ)' ./howto-index.sh $(sort $(wildcard howto/*.txt)) >$@+ && \
+ $(if $(SOURCE_DATE_EPOCH),touch -d '@$(SOURCE_DATE_EPOCH)' $@+ &&) \
mv $@+ $@
$(patsubst %,%.html,$(ARTICLES)) : %.html : %.txt
@@ -424,8 +425,10 @@ WEBDOC_DEST = /pub/software/scm/git/docs
howto/%.html: ASCIIDOC_EXTRA += -a git-relative-html-prefix=../
$(patsubst %.txt,%.html,$(wildcard howto/*.txt)): %.html : %.txt
$(QUIET_ASCIIDOC)$(RM) $@+ $@ && \
- sed -e '1,/^$$/d' $< | \
- $(TXT_TO_HTML) - >$@+ && \
+ sed -e '1,/^$$/d' $< > $<+ && \
+ $(if $(SOURCE_DATE_EPOCH),touch -d '@$(SOURCE_DATE_EPOCH)' $<+ &&) \
+ $(TXT_TO_HTML) -o $@+ $<+ && \
+ rm $<+ && \
mv $@+ $@
install-webdoc : html
diff --git a/Documentation/technical/api-index.sh b/Documentation/technical/api-index.sh
index 9c3f4131b8..87c9a9d223 100755
--- a/Documentation/technical/api-index.sh
+++ b/Documentation/technical/api-index.sh
@@ -20,6 +20,10 @@
sed -n -e '/^\/\/ table of contents end/,$p' "$skel"
) >api-index.txt+
+if [ "$SOURCE_DATE_EPOCH" ]; then
+ touch -d "@$SOURCE_DATE_EPOCH" api-index.txt+
+fi
+
if test -f api-index.txt && cmp api-index.txt api-index.txt+ >/dev/null
then
rm -f api-index.txt+
--
2.20.0.rc0.387.gc7a69e6b6c