Bug#872460: gcab: please make the output reproducible

Chris Lamb lamby at debian.org
Thu Aug 17 16:46:22 UTC 2017


Source: gcab
Version: 0.7-3
Severity: wishlist
Tags: patch
User: reproducible-builds at lists.alioth.debian.org
Usertags: timezone toolchain
X-Debbugs-Cc: reproducible-bugs at lists.alioth.debian.org

Hi,

Whilst working on the Reproducible Builds effort [0], we noticed
that gcab generates .cab files that are not reproducible. This
affects packages such as fwupd.

This is because the embedded dates are encoded with the current
timezone.

Patch attached.

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


Regards,

-- 
      ,''`.
     : :'  :     Chris Lamb
     `. `'`      lamby at debian.org / chris-lamb.co.uk
       `-
-------------- next part --------------
diff --git a/libgcab/gcab-file.c b/libgcab/gcab-file.c
index b55fbb5..e367610 100644
--- a/libgcab/gcab-file.c
+++ b/libgcab/gcab-file.c
@@ -136,7 +136,7 @@ gcab_file_update_info (GCabFile *self, GFileInfo *info)
 
     g_file_info_get_modification_time (info, &tv);
     time = tv.tv_sec;
-    m = localtime (&time);
+    m = gmtime (&time);
 
     self->cfile.name = self->name;
     self->cfile.usize = g_file_info_get_size (info);


More information about the Reproducible-bugs mailing list