Bug#886952: hwinfo: please make the build reproducible

Chris Lamb lamby at debian.org
Thu Jan 11 17:14:11 UTC 2018


Source: hwinfo
Version: 21.50-1
Severity: wishlist
Tags: patch
User: reproducible-builds at lists.alioth.debian.org
Usertags: timestamps
X-Debbugs-Cc: reproducible-bugs at lists.alioth.debian.org

Hi,

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

Whilst it uses SOURCE_DATE_EPOCH it varied depending on the timezone
via ctime(&t) instead of asctime(gmtime(&t)).

Patch attached.

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


Regards,

-- 
      ,''`.
     : :'  :     Chris Lamb
     `. `'`      lamby at debian.org / chris-lamb.co.uk
       `-
-------------- next part --------------
--- a/debian/patches/0007-Reproducible-build.patch	1970-01-01 05:30:00.000000000 +0530
--- b/debian/patches/0007-Reproducible-build.patch	2018-01-11 22:26:34.552953263 +0530
@@ -0,0 +1,15 @@
+Description: Make the build reproducible
+Author: Chris Lamb <lamby at debian.org>
+Last-Update: 2018-01-11
+
+--- hwinfo-21.50.orig/src/isdn/cdb/isdn_cdb.c
++++ hwinfo-21.50/src/isdn/cdb/isdn_cdb.c
+@@ -224,7 +224,7 @@ char **argv;
+ 	fprintf(stdout,"const int  CDBISDN_DBVERSION = 0x%x;\n", CDB_DATAVERSION);
+ 	if ((source_date_epoch = getenv("SOURCE_DATE_EPOCH")) == NULL || (tim = (time_t)strtol(source_date_epoch, NULL, 10)) <= 0)
+ 		time(&tim);
+-	strcpy(line,ctime(&tim));
++	strcpy(line,asctime(gmtime(&tim)));
+ 	l = strlen(line);
+ 	if (l)
+ 		line[l-1] = 0;
--- a/debian/patches/series	2018-01-11 21:44:47.705785367 +0530
--- b/debian/patches/series	2018-01-11 22:03:42.214293598 +0530
@@ -4,3 +4,4 @@
 0004-This-patch-fixes-a-segfault-on-amd64-architecture.patch
 0005-Fix-various-issues-with-the-manpage.patch
 0006-use-bin-udevadm-instead-of-sbin-udevadm.patch
+0007-Reproducible-build.patch


More information about the Reproducible-bugs mailing list