Source: osmo-iuh
Version: 0.2.0-1
Severity: wishlist
Tags: patch
User: [email protected]
Usertags: timestamps environment
X-Debbugs-Cc: [email protected]

Hi,

Whilst working on the Reproducible Builds effort [0], we noticed
that osmo-iuh could not be built reproducibly.

This is because it ships a header file containing the current
time and the current user in comments.

Patch attached.

 [0] https://reproducible-builds.org/


Regards,

-- 
      ,''`.
     : :'  :     Chris Lamb
     `. `'`      [email protected] / chris-lamb.co.uk
       `-
--- a/debian/patches/reproducible-build.patch   1970-01-01 01:00:00.000000000 
+0100
--- b/debian/patches/reproducible-build.patch   2018-04-22 08:52:50.656660701 
+0200
@@ -0,0 +1,29 @@
+Description: Make the build reproducible
+Author: Chris Lamb <[email protected]>
+Last-Update: 2018-04-22
+
+--- osmo-iuh-0.2.0.orig/asn1/utils/asn1tostruct.py
++++ osmo-iuh-0.2.0/asn1/utils/asn1tostruct.py
+@@ -3,7 +3,7 @@
+ import re, os, sys, string
+ import datetime
+ import getopt
+-import getpass
++import time
+ 
+ version = "0.5osmo1"
+ 
+@@ -33,11 +33,11 @@ def printDebug(string):
+         print string
+ 
+ def outputHeaderToFile(f, filename):
+-    now = datetime.datetime.now()
++    now = 
datetime.datetime.utcfromtimestamp(int(os.environ.get('SOURCE_DATE_EPOCH', 
time.time())))
+     
f.write("/*******************************************************************************\n")
+     f.write(" * This file had been created by asn1tostruct.py script v%s\n" % 
(version))
+     f.write(" * Please do not modify this file but regenerate it via 
script.\n")
+-    f.write(" * Created on: %s by %s\n * from %s\n" % (str(now), 
getpass.getuser(), filenames))
++    f.write(" * Created on: %s\n * from %s\n" % (str(now), filenames))
+     f.write(" 
******************************************************************************/\n")
+ 
+ def lowerFirstCamelWord(word):
--- a/debian/patches/series     2018-04-22 08:43:25.265607983 +0200
--- b/debian/patches/series     2018-04-22 08:52:49.596655136 +0200
@@ -1 +1,2 @@
 spelling.patch
+reproducible-build.patch

Reply via email to