Package: dpkg
Version: 1.18.4
Severity: wishlist
Tags: patch

Making dpkg-deb to be deterministic by fixing #719845 was good for
reproducible build.  But "dpkg-deb -c" output is not human friendly.

Basically, we want it to be sorted by name instead of internal data
order.

Please consider adding patch such as one attached to instruct tar to
change its default behavior.

One debatable point is when to sort output.  Instead of always sorting
by name, should we sort only when LIST?  Should we have option to
control it?
Pertinent code will be around below in dpkg-deb/extract.c:
      if ((taroption & DPKG_TAR_LIST) && (taroption & DPKG_TAR_EXTRACT))
        command_add_arg(&cmd, "-xv");
      else if (taroption & DPKG_TAR_EXTRACT)
        command_add_arg(&cmd, "-x");
      else if (taroption & DPKG_TAR_LIST)
        command_add_arg(&cmd, "-tv");
      else

If this is fixed, people will not complain like:
  https://bugs.debian.org/694515

Regards,

Osamu

-- System Information:
Debian Release: stretch/sid
  APT prefers testing
  APT policy: (500, 'testing'), (98, 'unstable')
Architecture: amd64 (x86_64)

Kernel: Linux 4.3.0-1-amd64 (SMP w/4 CPU cores)
Locale: LANG=en_US.utf8, LC_CTYPE=en_US.utf8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)

Versions of packages dpkg depends on:
ii  libbz2-1.0   1.0.6-8
ii  libc6        2.21-9
ii  liblzma5     5.1.1alpha+20120614-2.1
ii  libselinux1  2.4-3+b1
ii  tar          1.28-2.1
ii  zlib1g       1:1.2.8.dfsg-2+b1

dpkg recommends no packages.

Versions of packages dpkg suggests:
ii  apt  1.2.4

-- no debconf information
--- extract.c.orig	2016-03-07 22:44:03.421627595 +0900
+++ extract.c	2016-03-07 22:47:23.810190427 +0900
@@ -320,6 +320,7 @@
       command_init(&cmd, TAR, "tar");
       command_add_arg(&cmd, "tar");
 
+      command_add_arg(&cmd, "--sort=name");
       if ((taroption & DPKG_TAR_LIST) && (taroption & DPKG_TAR_EXTRACT))
         command_add_arg(&cmd, "-xv");
       else if (taroption & DPKG_TAR_EXTRACT)

Reply via email to