-
-
Notifications
You must be signed in to change notification settings - Fork 52
/
1101-docs-rename-DATE-to-PANDOC_REL_DATE-and-allow-to-spe.patch
50 lines (44 loc) · 1.69 KB
/
1101-docs-rename-DATE-to-PANDOC_REL_DATE-and-allow-to-spe.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
From c8256e48f9f0c98d34a12aa4880e8153ac84c4c8 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Pierret=20=28fepitre=29?=
Date: Sat, 7 Nov 2020 16:35:55 +0100
Subject: [PATCH] docs: rename DATE to PANDOC_REL_DATE and allow to specify it
PANDOC_REL_DATE is now defined with respect to
SOURCE_DATE_EPOCH (if set). It improves reproducibility.
---
INSTALL | 1 +
docs/Makefile | 4 ++--
2 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/INSTALL b/INSTALL
index 22fce650f9a0..14edf0b8ccce 100644
--- a/INSTALL
+++ b/INSTALL
@@ -234,6 +234,7 @@ XEN_BUILD_DATE=<output of date(1)>
XEN_BUILD_TIME=hh:mm:ss
SMBIOS_REL_DATE=mm/dd/yyyy
VGABIOS_REL_DATE="dd Mon yyyy"
+PANDOC_REL_DATE="+%Y-%m-%d"
It is sufficient to define only SOURCE_DATE_EPOCH instead of the above
variables for having reproducible builds. By default, they use
diff --git a/docs/Makefile b/docs/Makefile
index 966a104490ac..a9da3ce3e9b1 100644
--- a/docs/Makefile
+++ b/docs/Makefile
@@ -3,7 +3,7 @@ include $(XEN_ROOT)/Config.mk
-include $(XEN_ROOT)/config/Docs.mk
VERSION := $(shell $(MAKE) -C $(XEN_ROOT)/xen --no-print-directory xenversion)
-DATE := $(shell date +%Y-%m-%d)
+PANDOC_REL_DATE ?= $(shell date $(DATE_EPOCH_OPTS) +%Y-%m-%d)
DOC_ARCHES := arm x86_32 x86_64
MAN_SECTIONS := 1 5 7 8
@@ -98,7 +98,7 @@ man$(1)/%.$(1): man/%.$(1).pandoc Makefile
ifneq ($(PANDOC),)
@$(INSTALL_DIR) $$(@D)
$(PANDOC) --standalone -V title=$$* -V section=$(1) \
- -V date="$(DATE)" -V footer="$(VERSION)" \
+ -V date="$(PANDOC_REL_DATE)" -V footer="$(VERSION)" \
-V header=Xen $$< -t man --output $$@
else
@echo "pandoc not installed; skipping $$@"
--
2.44.0