From ac2b8869724d7a57d9b5efbdce2f20423214e8bb Mon Sep 17 00:00:00 2001 From: "Bernhard M. Wiedemann" Date: Tue, 16 Jul 2024 21:39:33 +0200 Subject: [PATCH] Allow to override build date with SOURCE_DATE_EPOCH to make builds reproducible. See https://reproducible-builds.org/ for why this is good and https://reproducible-builds.org/specs/source-date-epoch/ for the definition of this variable. --- Doc/conf.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Doc/conf.py b/Doc/conf.py index 29b1b2db32718b..6ab8e8ccbdfd96 100644 --- a/Doc/conf.py +++ b/Doc/conf.py @@ -347,7 +347,8 @@ } # This 'Last updated on:' timestamp is inserted at the bottom of every page. -html_last_updated_fmt = time.strftime('%b %d, %Y (%H:%M UTC)', time.gmtime()) +html_time = int(os.environ.get('SOURCE_DATE_EPOCH', time.time())) +html_last_updated_fmt = time.strftime('%b %d, %Y (%H:%M UTC)', time.gmtime(html_time)) # Path to find HTML templates. templates_path = ['tools/templates']