Source: pysal
Version: 1.11.2-1
Severity: wishlist
Tags: patch
User: reproducible-builds@lists.alioth.debian.org
Usertags: timestamps
X-Debbugs-Cc: reproducible-builds@lists.alioth.debian.org

Hi,

Whilst working on the "reproducible builds" effort [0], we noticed
that pysal could not be built reproducibly.

Patch attached.

 [0] https://wiki.debian.org/ReproducibleBuilds


Regards,

-- 
      ,''`.
     : :'  :     Chris Lamb
     `. `'`      la...@debian.org / chris-lamb.co.uk
       `-
--- a/debian/patches/reproducible-build-and-output.patch        1969-12-31 
19:00:00.000000000 -0500
--- b/debian/patches/reproducible-build-and-output.patch        2016-07-30 
09:26:08.972016141 -0400
@@ -0,0 +1,26 @@
+Description: Make the output and build reproducible
+Author: Chris Lamb <la...@debian.org>
+Last-Update: 2016-07-30
+
+--- pysal-1.11.2.orig/pysal/core/IOHandlers/pyDbfIO.py
++++ pysal-1.11.2/pysal/core/IOHandlers/pyDbfIO.py
+@@ -4,6 +4,8 @@ import struct
+ import itertools
+ from warnings import warn
+ import pysal
++import os
++import time
+ 
+ __author__ = "Charles R Schmidt <schmi...@gmail.com>"
+ __all__ = ['DBF']
+@@ -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)
--- a/debian/patches/series     2016-07-30 09:12:22.522044500 -0400
--- b/debian/patches/series     2016-07-30 09:26:01.392034744 -0400
@@ -1 +1,2 @@
 unusual-interpreter.patch
+reproducible-build-and-output.patch
_______________________________________________
Reproducible-builds mailing list
Reproducible-builds@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/reproducible-builds

Reply via email to