equal
deleted
inserted
replaced
|
1 Author: Bernhard M. Wiedemann <bwiedemann suse de> |
|
2 Date: 2019-07-22 |
|
3 |
|
4 Allow to override build date with SOURCE_DATE_EPOCH |
|
5 in order to make builds reproducible. |
|
6 See https://reproducible-builds.org/ for why this is good |
|
7 and https://reproducible-builds.org/specs/source-date-epoch/ |
|
8 for the definition of this variable. |
|
9 |
|
10 diff --git a/python/mozbuild/mozbuild/action/langpack_manifest.py b/python/mozbuild/mozbuild/action/langpack_manifest.py |
|
11 index 6f72697..d4cca96 100644 |
|
12 --- a/python/mozbuild/mozbuild/action/langpack_manifest.py |
|
13 +++ b/python/mozbuild/mozbuild/action/langpack_manifest.py |
|
14 @@ -16,6 +16,7 @@ import os |
|
15 import json |
|
16 import io |
|
17 import datetime |
|
18 +import time |
|
19 import requests |
|
20 import mozversioncontrol |
|
21 import mozpack.path as mozpath |
|
22 @@ -100,7 +101,7 @@ def get_timestamp_for_locale(path): |
|
23 dt = get_dt_from_hg(path) |
|
24 |
|
25 if dt is None: |
|
26 - dt = datetime.datetime.utcnow() |
|
27 + dt = datetime.datetime.utcfromtimestamp(int(os.environ.get('SOURCE_DATE_EPOCH', time.time()))) |
|
28 |
|
29 dt = dt.replace(microsecond=0) |
|
30 return dt.strftime("%Y%m%d%H%M%S") |