Bug#832997: pysal: please make the build reproducible
Sebastiaan Couwenberg
sebastic at xs4all.nl
Sat Jul 30 17:31:56 UTC 2016
On 07/30/2016 07:27 PM, Chris Lamb wrote:
>> I've tweaked it a bit to make your changes conditional on
>> SOURCE_DATE_EPOCH being set in the environment
>
> It already was, no?
No. From your original patch:
@@ -272,7 +274,9 @@ class DBF(pysal.core.Tables.DataTable):
POS = self.f.tell()
self.f.seek(0)
ver = 3
- now = datetime.datetime.now()
+ now = datetime.datetime.utcfromtimestamp(
+ int(os.environ.get('SOURCE_DATE_EPOCH', time.time())),
+ )
yr, mon, day = now.year - 1900, now.month, now.day
numrec = self.numrec
numfields = len(self.header)
Which I changed to:
@@ -272,7 +274,12 @@ class DBF(pysal.core.Tables.DataTable):
POS = self.f.tell()
self.f.seek(0)
ver = 3
- now = datetime.datetime.now()
+ if 'SOURCE_DATE_EPOCH' in os.environ:
+ now = datetime.datetime.utcfromtimestamp(
+ int(os.environ.get('SOURCE_DATE_EPOCH', time.time())),
+ )
+ else:
+ now = datetime.datetime.now()
yr, mon, day = now.year - 1900, now.month, now.day
numrec = self.numrec
numfields = len(self.header)
Kind Regards,
Bas
--
GPG Key ID: 4096R/6750F10AE88D4AF1
Fingerprint: 8182 DE41 7056 408D 6146 50D1 6750 F10A E88D 4AF1
More information about the Pkg-grass-devel
mailing list