[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [XEN PATCH 2/5] docs: set DATE to SOURCE_DATE_EPOCH if available
Use the solution described in [1] to replace the call to the 'date' command with a version that uses SOURCE_DATE_EPOCH if available. This is needed for reproducible builds. The -d "@..." syntax was introduced in GNU date about 2005 (but only added to the docuemntation in 2011), so I assume a version supporting this syntax is available, if SOURCE_DATE_EPOCH is defined. If SOURCE_DATE_EPOCH is not defined, nothing changes with respect to the current behavior. [1] https://reproducible-builds.org/docs/source-date-epoch/ Signed-off-by: Maximilian Engelhardt <maxi@xxxxxxxxxxxxx> --- docs/Makefile | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/docs/Makefile b/docs/Makefile index b30cc619f8..beba02a94f 100644 --- a/docs/Makefile +++ b/docs/Makefile @@ -3,7 +3,13 @@ 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) + +DATE_FMT := +%Y-%m-%d +ifdef SOURCE_DATE_EPOCH +DATE := $(shell date -u -d "@$(SOURCE_DATE_EPOCH)" "$(DATE_FMT)" 2>/dev/null || date -u -r "$(SOURCE_DATE_EPOCH)" "$(DATE_FMT)" 2>/dev/null || date -u "$(DATE_FMT)") +else +DATE := $(shell date "$(DATE_FMT)") +endif DOC_ARCHES := arm x86_32 x86_64 MAN_SECTIONS := 1 5 7 8 -- 2.39.5
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |