Skip to content

Use SOURCE_DATE_EPOCH for date in order to make build reproducible

SOURCE_DATE_EPOCH is a variable set by distributions to make build reproducible, see more here: https://reproducible-builds.org/docs/source-date-epoch/

Would you consider to accept this patch?

--- a/branding/scripts/provider.py
+++ b/branding/scripts/provider.py
@@ -1,4 +1,4 @@
-import datetime
+import time
 import os
 
 
@@ -46,7 +46,7 @@
                 # remove spaces
                 d[value] = [x.strip() for x in d[value]]
 
-    d['timeStamp'] = '{:%Y-%m-%d %H:%M:%S}'.format(
-        datetime.datetime.now())
+    d['timeStamp'] = time.strftime("%Y-%m-%d %H:%M:%S",
+                                   time.gmtime(int(os.environ.get('SOURCE_DATE_EPOCH', time.time()))))
 
     return d