All of lore.kernel.org
 help / color / mirror / Atom feed
* [RESEND] [XEN PATCH v1 0/1] Use reproducible date in docs
@ 2021-02-13 14:48 Maximilian Engelhardt
  2021-02-13 14:48 ` [XEN PATCH v1 1/1] docs: set date to SOURCE_DATE_EPOCH if available Maximilian Engelhardt
  0 siblings, 1 reply; 2+ messages in thread
From: Maximilian Engelhardt @ 2021-02-13 14:48 UTC (permalink / raw)
  To: xen-devel; +Cc: Maximilian Engelhardt, Ian Jackson, Wei Liu, Jan Beulich

This is a resend of my v1 patch from [1] which has not been accepted
yet.

The -d "@..." syntax was introduced in GNU date about 2005, 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.

In response to my first submission Jan Beulich mentioned in [2] it would
be good to probe for the availability of the -d "@..." syntax of GNU
date, as Jan couldn't find it when looking at an older documentation of
GNU date. I later found out and reported in [3] that while the syntax
has been implemented in GNU date in about 2005, the documentation has
only been updated in 2011.

I also submitted a v2 version that implemented the suggested probing of
the capabilities of the "date" command in [4]. However Wei Liu responded
a shorter version of the patch would be preferred, so I'm resending v1
now.

I'm fine with v1 or v2, both fix the issue of generating reproducible
documentation. This patch is the last upstream patch needed for get xen
built reproducibly in the next Debian release.

If both patches are not seen as appropriate, please tell me what changes
I should implement.

Thanks,
Maxi

[1] https://lists.xenproject.org/archives/html/xen-devel/2020-12/msg01518.html
[2] https://lists.xenproject.org/archives/html/xen-devel/2020-12/msg01564.html
[3] https://lists.xenproject.org/archives/html/xen-devel/2020-12/msg01698.html
[4] https://lists.xenproject.org/archives/html/xen-devel/2020-12/msg01715.html
[5] https://lists.xenproject.org/archives/html/xen-devel/2021-01/msg00178.html

Maximilian Engelhardt (1):
  docs: set date to SOURCE_DATE_EPOCH if available

 docs/Makefile | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

-- 
2.20.1



^ permalink raw reply	[flat|nested] 2+ messages in thread

* [XEN PATCH v1 1/1] docs: set date to SOURCE_DATE_EPOCH if available
  2021-02-13 14:48 [RESEND] [XEN PATCH v1 0/1] Use reproducible date in docs Maximilian Engelhardt
@ 2021-02-13 14:48 ` Maximilian Engelhardt
  0 siblings, 0 replies; 2+ messages in thread
From: Maximilian Engelhardt @ 2021-02-13 14:48 UTC (permalink / raw)
  To: xen-devel; +Cc: Maximilian Engelhardt, Ian Jackson, Wei Liu, Jan Beulich

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.

[1] https://reproducible-builds.org/docs/source-date-epoch/

Signed-off-by: Maximilian Engelhardt <maxi@daemonizer.de>
---
 docs/Makefile | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/docs/Makefile b/docs/Makefile
index 8de1efb6f5..ac6792ff7c 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.20.1



^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-02-13 14:49 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-13 14:48 [RESEND] [XEN PATCH v1 0/1] Use reproducible date in docs Maximilian Engelhardt
2021-02-13 14:48 ` [XEN PATCH v1 1/1] docs: set date to SOURCE_DATE_EPOCH if available Maximilian Engelhardt

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.