Source: pagekite
Version: 0.5.8e-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 pagekite could not be built reproducibly.

Patch attached.

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


Regards,

-- 
      ,''`.
     : :'  :     Chris Lamb
     `. `'`      la...@debian.org / chris-lamb.co.uk
       `-
diff --git a/pagekite/compat.py b/pagekite/compat.py
index b8d67e5..269e657 100755
--- a/pagekite/compat.py
+++ b/pagekite/compat.py
@@ -48,9 +48,9 @@ if not 'SHUT_RD' in dir(socket):
 
 try:
   import datetime
-  ts_to_date = datetime.datetime.fromtimestamp
+  ts_to_date = datetime.datetime.utcfromtimestamp
   def ts_to_iso(ts=None):
-    return datetime.datetime.fromtimestamp(ts).isoformat()
+    return datetime.datetime.utcfromtimestamp(ts).isoformat()
 except ImportError:
   ts_to_date = str
   ts_to_iso = str
diff --git a/pagekite/manual.py b/pagekite/manual.py
index 11eb43d..3191fa8 100755
--- a/pagekite/manual.py
+++ b/pagekite/manual.py
@@ -2,6 +2,7 @@
 """
 The program manual!
 """
+import os
 import re
 import time
 
@@ -454,7 +455,7 @@ def MAN(pname=None):
 .TH PAGEKITE "1" "%s" "https://pagekite.net/"; "Awesome Commands"
 .nh
 .ad l
-""") % ts_to_iso(time.time()).split('T')[0]
+""") % ts_to_iso(int(os.environ.get('SOURCE_DATE_EPOCH', 
time.time()))).split('T')[0]
   for h, section, text in MANUAL_TOC:
     man += ('.%s %s\n\n%s\n\n'
             ) % (h, h == 'SH' and section.upper() or section,
_______________________________________________
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