mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Add pointers to the SOURCE_DATE_EPOCH specification.
This commit is contained in:
parent
d978f93954
commit
0f33e6cb64
@ -130,6 +130,8 @@ class I18nBuilder(Builder):
|
|||||||
timestamp = time()
|
timestamp = time()
|
||||||
tzdelta = datetime.fromtimestamp(timestamp) - \
|
tzdelta = datetime.fromtimestamp(timestamp) - \
|
||||||
datetime.utcfromtimestamp(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')
|
source_date_epoch = getenv('SOURCE_DATE_EPOCH')
|
||||||
if source_date_epoch is not None:
|
if source_date_epoch is not None:
|
||||||
timestamp = float(source_date_epoch)
|
timestamp = float(source_date_epoch)
|
||||||
|
@ -301,7 +301,8 @@ class Config(object):
|
|||||||
self.extensions = config.get('extensions', [])
|
self.extensions = config.get('extensions', [])
|
||||||
|
|
||||||
# correct values of copyright year that are not coherent with
|
# 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:
|
if getenv('SOURCE_DATE_EPOCH') is not None:
|
||||||
for k in ('copyright', 'epub_copyright'):
|
for k in ('copyright', 'epub_copyright'):
|
||||||
if k in config:
|
if k in config:
|
||||||
|
Loading…
Reference in New Issue
Block a user