summaryrefslogtreecommitdiffstats
path: root/SConstruct
diff options
context:
space:
mode:
authorBernhard M. Wiedemann <bwiedemann@suse.de>2018-10-14 02:45:24 (GMT)
committerBernhard M. Wiedemann <bwiedemann@suse.de>2018-10-15 02:29:56 (GMT)
commita61f52da75cad382d482ae13a9e3d30d4870f87b (patch)
tree53f954982e376354227df2aff5076d169561f9bc /SConstruct
parent0c20ae2e5d1e093a3993f94eba454ca110cf1dd3 (diff)
downloadSCons-a61f52da75cad382d482ae13a9e3d30d4870f87b.zip
SCons-a61f52da75cad382d482ae13a9e3d30d4870f87b.tar.gz
SCons-a61f52da75cad382d482ae13a9e3d30d4870f87b.tar.bz2
Allow to override build date with SOURCE_DATE_EPOCH
in order 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. Also consistently use ISO 8601 date format to be understood everywhere. Also use gmtime to be independent of timezone.
Diffstat (limited to 'SConstruct')
-rw-r--r--SConstruct2
1 files changed, 1 insertions, 1 deletions
diff --git a/SConstruct b/SConstruct
index f644d6d..773bacb 100644
--- a/SConstruct
+++ b/SConstruct
@@ -73,7 +73,7 @@ zip = whereis('zip')
#
date = ARGUMENTS.get('DATE')
if not date:
- date = time.strftime("%Y/%m/%d %H:%M:%S", time.localtime(time.time()))
+ date = time.strftime("%Y-%m-%d %H:%M:%S", time.gmtime(int(os.environ.get('SOURCE_DATE_EPOCH', time.time()))))
developer = ARGUMENTS.get('DEVELOPER')
if not developer: