From 0f33e6cb6460d22fdb51630205b77e3c67556cd2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexis=20Bienven=C3=BCe?= Date: Tue, 3 May 2016 09:53:54 +0200 Subject: [PATCH] Add pointers to the SOURCE_DATE_EPOCH specification. --- sphinx/builders/gettext.py | 2 ++ sphinx/config.py | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/sphinx/builders/gettext.py b/sphinx/builders/gettext.py index 1a30dd0fc..1c4789392 100644 --- a/sphinx/builders/gettext.py +++ b/sphinx/builders/gettext.py @@ -130,6 +130,8 @@ class I18nBuilder(Builder): timestamp = time() tzdelta = datetime.fromtimestamp(timestamp) - \ datetime.utcfromtimestamp(timestamp) +# set timestamp from SOURCE_DATE_EPOCH if set +# see https://reproducible-builds.org/specs/source-date-epoch/ source_date_epoch = getenv('SOURCE_DATE_EPOCH') if source_date_epoch is not None: timestamp = float(source_date_epoch) diff --git a/sphinx/config.py b/sphinx/config.py index 5ce807f7a..9cbf655f8 100644 --- a/sphinx/config.py +++ b/sphinx/config.py @@ -301,7 +301,8 @@ class Config(object): self.extensions = config.get('extensions', []) # correct values of copyright year that are not coherent with - # the SOURCE_DATE_EPOCH environment variable: + # the SOURCE_DATE_EPOCH environment variable (if set) + # See https://reproducible-builds.org/specs/source-date-epoch/ if getenv('SOURCE_DATE_EPOCH') is not None: for k in ('copyright', 'epub_copyright'): if k in config: