Your message dated Thu, 14 Sep 2017 03:05:16 +0000
with message-id <[email protected]>
and subject line Bug#872514: fixed in devscripts 2.17.10
has caused the Debian Bug report #872514,
regarding devscripts: Please add script to report on reproducibility status of 
installed packages
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [email protected]
immediately.)


-- 
872514: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=872514
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
Package: devscripts
Version: 2.17.9
Severity: wishlist
Tags: patch
User: [email protected]
Usertags: toolchain
X-Debbugs-Cc: [email protected]

Hi!

Thanks for your work on devscripts. Attached is the following:

  commit 57512128c75ac74b6cfa3c70a0613ba85789b992
  Author: Chris Lamb <[email protected]>
  Date:   Thu Aug 17 17:07:16 2017 -0700
  
      reproducible-check: New script to report on reproducibility status
        of installed packages.
      
      Signed-off-by: Chris Lamb <[email protected]>
  
   .gitignore                 |   1 +
   debian/control             |   7 ++
   debian/copyright           |   6 ++
   scripts/Makefile           |   7 +-
   scripts/reproducible-check | 170 
+++++++++++++++++++++++++++++++++++++++++++++
   scripts/setup.py           |   2 +-
   6 files changed, 190 insertions(+), 3 deletions(-)

Example output:

  $ reproducible-check
  […]
  xen (4.8.1-1+deb9u1) is unreproducible (libxen-4.8, libxenstore3.0) 
<https://tests.reproducible-builds.org/debian/xen>
  xmlrpc-c (1.33.14-4) is unreproducible (libxmlrpc-core-c3) 
<https://tests.reproducible-builds.org/debian/xmlrpc-c>
  xmlstarlet (1.6.1-2) is unreproducible 
<https://tests.reproducible-builds.org/debian/xmlstarlet>
  xorg-server (2:1.19.3-2) is unreproducible (xserver-xephyr, 
xserver-xorg-core) <https://tests.reproducible-builds.org/debian/xorg-server>
  zsh (5.4.1-1) is unreproducible 
<https://tests.reproducible-builds.org/debian/zsh>
    366/4083 (8.96%) of installed binary packages are unreproducible.

Also:

  $ reproducible-check --raw | dd-list -i
  […]
  Torsten Marek <[email protected]>
     pycairo (U)
    
  Vagrant Cascadian <[email protected]>
     qemu (U)
    
  Vincent Fourmond <[email protected]>
     imagemagick (U)
    
  Yury V. Zaytsev <[email protected]>
     mc (U)


Regards,

-- 
      ,''`.
     : :'  :     Chris Lamb
     `. `'`      [email protected] / chris-lamb.co.uk
       `-
>From 57512128c75ac74b6cfa3c70a0613ba85789b992 Mon Sep 17 00:00:00 2001
From: Chris Lamb <[email protected]>
Date: Thu, 17 Aug 2017 17:07:16 -0700
Subject: [PATCH] reproducible-check: New script to report on reproducibility
 status of installed packages.

Signed-off-by: Chris Lamb <[email protected]>
---
 .gitignore                 |   1 +
 debian/control             |   7 ++
 debian/copyright           |   6 ++
 scripts/Makefile           |   7 +-
 scripts/reproducible-check | 170 +++++++++++++++++++++++++++++++++++++++++++++
 scripts/setup.py           |   2 +-
 6 files changed, 190 insertions(+), 3 deletions(-)
 create mode 100755 scripts/reproducible-check

diff --git a/.gitignore b/.gitignore
index e96730cd..248fd399 100644
--- a/.gitignore
+++ b/.gitignore
@@ -98,6 +98,7 @@ scripts/origtargz.1
 scripts/plotchangelog
 scripts/pts-subscribe
 scripts/rc-alert
+scripts/reproducible-check.1
 scripts/rmadison
 scripts/rmadison.1
 scripts/sadt.1
diff --git a/debian/control b/debian/control
index 82165b80..6eac2ce5 100644
--- a/debian/control
+++ b/debian/control
@@ -13,6 +13,7 @@ Build-Depends: bash-completion,
                dpkg-dev (>= 1.17.6),
                file,
                gnupg | gnupg2,
+               help2man,
                libdistro-info-perl,
                libdpkg-perl,
                libfile-desktopentry-perl,
@@ -29,11 +30,14 @@ Build-Depends: bash-completion,
                po4a (>= 0.40),
                pylint,
                python3-all,
+               python3-apt,
                python3-debian (>= 0.1.15),
                python3-flake8,
                python3-magic,
+               python3-requests,
                python3-setuptools,
                python3-unidiff <!nocheck>,
+               python3-xdg,
                shunit2 (>= 2.1.6),
                unzip,
                wdiff,
@@ -72,9 +76,12 @@ Recommends: apt,
             man-db,
             patch,
             patchutils,
+            python3-apt,
             python3-debian (>= 0.1.15),
             python3-magic,
+            python3-requests,
             python3-unidiff,
+            python3-xdg,
             sensible-utils,
             strace,
             unzip,
diff --git a/debian/copyright b/debian/copyright
index c22addad..95550dc7 100644
--- a/debian/copyright
+++ b/debian/copyright
@@ -68,6 +68,12 @@ Copyright: 2009,      Jonathan Patrick Davies <[email protected]>
            2006-2008, Kees Cook <[email protected]>
            2007-2008, Siegfried-Angel Gevatter Pujals <[email protected]>
            2013,      Rafael Laboissiere <[email protected]>
+License: GPL-3+
+
+Files: scripts/reproducible-check
+Copyright: © 2017 Chris Lamb <[email protected]>
+License: GPL-3+
+
 License: GPL-3+
  This program is free software; you can redistribute it and/or modify
  it under the terms of the GNU General Public License as published by
diff --git a/scripts/Makefile b/scripts/Makefile
index ece5455a..21ed11a6 100644
--- a/scripts/Makefile
+++ b/scripts/Makefile
@@ -24,9 +24,9 @@ COMPLETION = $(patsubst %.bash_completion,$(BC_BUILD_DIR)/%,$(COMPL_FILES))
 COMPL_DIR := $(shell pkg-config --variable=completionsdir bash-completion)
 PKGNAMES:=wnpp-alert wnpp-check mk-build-deps rmadison mass-bug debsnap dd-list build-rdeps who-uploads transition-check getbuildlog dcontrol grep-excuses rc-alert whodepends dget pts-subscribe pts-unsubscribe debcheckout
 # also update the list in setup.py
-PYTHON3_SCRIPTS:=debdiff-apply sadt suspicious-source wrap-and-sort
+PYTHON3_SCRIPTS:=debdiff-apply sadt suspicious-source wrap-and-sort reproducible-check
 
-GEN_MAN1S += debrepro.1 devscripts.1 mk-origtargz.1 uscan.1
+GEN_MAN1S += debrepro.1 devscripts.1 mk-origtargz.1 uscan.1 reproducible-check.1
 
 all: $(SCRIPTS) $(GEN_MAN1S) $(CWRAPPERS) $(COMPLETION)
 
@@ -74,6 +74,9 @@ devscripts.1: devscripts.1.in
 	perl ../debian/genmanpage.pl >> $@.$(PID)
 	mv $@.$(PID) $@
 
+reproducible-check.1: reproducible-check
+	help2man --no-info --no-discard-stderr ./reproducible-check >$@
+
 $(BC_BUILD_DIR):
 	mkdir $(BC_BUILD_DIR)
 
diff --git a/scripts/reproducible-check b/scripts/reproducible-check
new file mode 100755
index 00000000..518214ce
--- /dev/null
+++ b/scripts/reproducible-check
@@ -0,0 +1,170 @@
+#!/usr/bin/env python3
+#
+# Copyright (C) 2017 Chris Lamb <[email protected]>
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or (at
+# your option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+import os
+import bz2
+import apt
+import sys
+import json
+import logging
+import requests
+import argparse
+import collections
+
+from xdg.BaseDirectory import xdg_cache_home
+
+
+class ReproducibleCheck(object):
+    HELP = """
+        Reports on the reproducible status of installed packages.
+        For more details please see <https://reproducible-builds.org>.
+    """
+
+    NAME = os.path.basename(__file__)
+    CACHE = os.path.join(xdg_cache_home, NAME, 'reproducible.json.bz')
+    VERSION = 1
+    STATUS_URL = 'https://tests.reproducible-builds.org/reproducible.json.bz2'
+
+    @classmethod
+    def parse(cls):
+        parser = argparse.ArgumentParser(description=cls.HELP)
+
+        parser.add_argument(
+            '-d',
+            '--debug',
+            help="show debugging messages",
+            default=False,
+            action='store_true',
+        )
+
+        parser.add_argument(
+            '-r',
+            '--raw',
+            help="print unreproducible binary packages only (for dd-list -i)",
+            default=False,
+            action='store_true',
+        )
+
+        parser.add_argument(
+            '--version',
+            help="print version and exit",
+            default=False,
+            action='store_true',
+        )
+
+        return cls(parser.parse_args())
+
+    def __init__(self, args):
+        self.args = args
+
+        logging.basicConfig(
+            format='%(asctime).19s %(levelname).1s: %(message)s',
+            level=logging.DEBUG if args.debug else logging.INFO,
+        )
+
+        self.log = logging.getLogger()
+
+    def main(self):
+        if self.args.version:
+            print("{} version {}".format(self.NAME, self.VERSION))
+            return 0
+
+        self.update_cache()
+
+        data = self.get_data()
+        installed = self.get_installed_packages()
+        unreproducible = {x: y for x, y in installed.items() if x in data}
+
+        if self.args.raw:
+            self.output_raw(unreproducible, installed)
+        else:
+            self.output_by_source(unreproducible, installed)
+
+        return 0
+
+    def update_cache(self):
+        self.log.debug("Checking cache file %s ...", self.CACHE)
+
+        if os.path.exists(self.CACHE):
+            self.log.debug("Cache is up to date")
+            return
+
+        self.log.info("Updating cache...")
+
+        response = requests.get(self.STATUS_URL)
+
+        os.makedirs(os.path.dirname(self.CACHE), exist_ok=True)
+
+        with open(self.CACHE, 'wb+') as f:
+            f.write(response.content)
+
+    def get_data(self):
+        self.log.debug("Loading data from cache %s", self.CACHE)
+
+        with bz2.open(self.CACHE) as f:
+            return {
+                (x['package'], x['architecture'], x['version'])
+                for x in json.loads(f.read().decode('utf-8'))
+                if x['status'] == 'unreproducible'
+            }
+
+    def get_installed_packages(self):
+        result = collections.defaultdict(list)
+
+        for x in apt.Cache():
+            for y in x.versions:
+                if not y.is_installed:
+                    continue
+
+                key = (y.source_name, y.architecture, y.version)
+                result[key].append(x.shortname)
+
+        return result
+
+    def output_by_source(self, unreproducible, installed):
+        num_installed = sum(len(x) for x in installed.keys())
+        num_unreproducible = sum(len(x) for x in unreproducible.keys())
+
+        for key, binaries in sorted(unreproducible.items()):
+            source, architecture, version = key
+
+            binaries_fmt = '({}) '.format(', '.join(binaries)) \
+                if binaries != [source] else ''
+
+            print("{} ({}) is unreproducible {}".format(
+                source,
+                version,
+                binaries_fmt,
+            ), end='')
+            print("<https://tests.reproducible-builds.org/debian/{}>".format(source))
+
+        print("{}/{} ({:.2f}%) of installed binary packages are unreproducible.".format(
+            num_unreproducible,
+            num_installed,
+            100. * num_unreproducible / num_installed,
+        ))
+
+    def output_raw(self, unreproducible, installed):
+        for x in sorted(x for xs in unreproducible.values() for x in xs):
+            print(x)
+
+
+if __name__ == '__main__':
+    try:
+        sys.exit(ReproducibleCheck.parse().main())
+    except (KeyboardInterrupt, BrokenPipeError):
+        sys.exit(1)
diff --git a/scripts/setup.py b/scripts/setup.py
index 69884a5c..091e4d32 100755
--- a/scripts/setup.py
+++ b/scripts/setup.py
@@ -12,7 +12,7 @@ if os.path.exists(changelog):
     if match:
         version = match.group(1)
 
-scripts = "debdiff-apply sadt suspicious-source wrap-and-sort".split()
+scripts = "debdiff-apply sadt suspicious-source wrap-and-sort reproducible-check".split()
 
 if __name__ == '__main__':
     setup(
-- 
2.14.1


--- End Message ---
--- Begin Message ---
Source: devscripts
Source-Version: 2.17.10

We believe that the bug you reported is fixed in the latest version of
devscripts, which is due to be installed in the Debian FTP archive.

A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to [email protected],
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
James McCoy <[email protected]> (supplier of updated devscripts package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing [email protected])


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512

Format: 1.8
Date: Wed, 13 Sep 2017 22:08:30 -0400
Source: devscripts
Binary: devscripts
Architecture: source
Version: 2.17.10
Distribution: unstable
Urgency: medium
Maintainer: Devscripts Devel Team <[email protected]>
Changed-By: James McCoy <[email protected]>
Description:
 devscripts - scripts to make the life of a Debian Package maintainer easier
Closes: 698240 727096 753838 807754 820426 832267 837173 837380 840232 840943 
842468 845610 852537 864914 869150 869842 870281 870640 872514 873289 873379 
874569 874666 874667
Changes:
 devscripts (2.17.10) unstable; urgency=medium
 .
   [ Mattia Rizzolo ]
   * debian/tests/control:
     + Add dependency on debhelper; apparently autopkgtest in ubuntu doesn't
       pull it otherwise
   * debian/control:
     + Mark build-dependencies needed only for the tests with the <!nocheck>
       build profile; partially addresses: #870640
   * debian/source/options:
     + Remove the file, compression=xz has been the default for a long while.
   * debian/TODO:
     + Remove the file, unusued (=> outdated) since 2008 and mostly empty.
   * debian/rules:
     + Enable hardening build flags.  Closes: #873379
       Thanks Chris Lamb <[email protected]> for the patch.
   * reproducible-check:
     + New script from Chris Lamb to check the reproducibility status of the
       installed packages.  Closes: #872514
 .
   [ Antonio Terceiro ]
   * debc:
     + add --list-changes option, similar to --list-debs but for displaying the
       path to the .changes file.
   * debrepro:
     + proof-read manpage.
 .
   [ James McCoy ]
   * Add hardening-check script.
   * debuild:
     + Add "--" in --help output for debian/rules mode.
   * test_package_lifecycle:
     + Fix expected output when run as root.
   * build-rdeps:
     + Use apt interfaces to find and read the sources files, fixing --old
       (non-dose) behavior when sources files are compressed.  (Closes:
       #698240)
     + Check Build-Depends-Arch for dependencies.
   * debcheckout:
     + Using --auth for git repositories now performs the clone with the
       Vcs-Git URL, but sets remote.<name>.pushurl to the rewritten
       authenticated URL.  Thanks to Andreas Henriksson for the patch!
       (Closes: #753838)
   * debsign:
     + Use --with-colons in bash completion to fix key completion with gpg2.
       (Closes: #837380)
   * rc-alert:
     + Clarify the error when curl/wget dies.  (Closes: #820426)
   * suspicious-source:
     + Whitelist elisp (.el) files.  (Closes: #807754)
   * Declare compliance with Policy 4.1.0, no changes needed.
 .
   [ Daniel Shahaf ]
   * bts:
     + Add devscripts.conf(5) to "See also".  Closes: #869842
 .
   [ Osamu Aoki ]
   * uscan:
     + Fix the new package version regex for filenamemangle.  Closes: #869150
     + Fix example URL for pagemangle.  Closes: #864914
     + Set $origcount to 0 for each watch file. Closes: #840232
     + Don't fail on pgpmode=auto. Closes: #852537
     + Don't fail on pgpmode=previous. Closes: #840943, #873289
     + Rename and convert the detached signature with updated mk-origtargz.
       Closes: #727096, #874666
     + Use correct extension for the downloaded signature. Closes: #874569
   * mk-origtargz
     + Rename and convert the detached signature. Closes: #832267, #837173,
       #870281
     + Skip upstream signature when repacking.  Closes: #874667
   * uupdate
     + -b option is not "New upstream release". Closes: #842468, #845610
     + Use space as the argument of debchange to create an empty entry
       template.
   * debchange: Handle multimaint case properly.  Closes: #842468
   * Made source package bootstrappable. Closes: #870640
 .
   [ Antonio Terceiro ]
   * suspicious-source:
     - whitelist text/x-ruby
     - whitelist text/xml
Checksums-Sha1:
 cef860868e91c1ec0f7d75cff97761e1b0ca7656 2829 devscripts_2.17.10.dsc
 8ecac384a5e00d50e50c1eeaf554ba32459da22f 706396 devscripts_2.17.10.tar.xz
 f991962a208057889240f19d4ebc2e655b3d43c6 10278 
devscripts_2.17.10_amd64.buildinfo
Checksums-Sha256:
 cd668fd1518e91406fac56e4c56c377decc27b62ae425940d5036f8860e3039e 2829 
devscripts_2.17.10.dsc
 fc28882f4e6f6a0a74119b811df308dac758e1a097f947398ae895e574043aff 706396 
devscripts_2.17.10.tar.xz
 f5b61278728b69513ec19ebd5007018431a95e4614cf6a2b78d1e20d05454bf1 10278 
devscripts_2.17.10_amd64.buildinfo
Files:
 2337232aa497994c6cf7b2b1aae3bb93 2829 devel optional devscripts_2.17.10.dsc
 3cc5885c54153017173813134d74d33c 706396 devel optional 
devscripts_2.17.10.tar.xz
 80ac49a5993d2e1e3cc97dbcd1796062 10278 devel optional 
devscripts_2.17.10_amd64.buildinfo

-----BEGIN PGP SIGNATURE-----

iQKSBAEBCgB9FiEEkb+/TWlWvV33ty0j3+aRrjMbo9sFAlm55rpfFIAAAAAALgAo
aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldDkx
QkZCRjRENjk1NkJENURGN0I3MkQyM0RGRTY5MUFFMzMxQkEzREIACgkQ3+aRrjMb
o9sbrQ/3TJz47vp9H0O/lgCC3E+4AcmmcVg+J7A4/i5UQutabflGWHwxdt7SYvME
CJeM/dTWYGONY1GasCv8wOXja+uIJsT7iXhKJClNgVvwp8O4EeKmLXVHtToxd4IC
x+5W/MEW0GcOAUMb6jiFZFYrNpvmmxMKkhe4NZYd5GsuhXoyT8FtxcOUqYnDHkYS
3cm+RnkRHl6YZ90uH+B6xHhuOIDuVUzcjn99rngMGxY5iU9PaaFqIP5MWb+P5x0a
BOaWKHnHPCBR5+pE+f1OESvpG1M1+xzkCqx7ImdDbKSt0FUr3WAWh7qwts8T9L0C
I0kfQEAAiouUpQwydkyM+6+Vt024cgMo+4o4uLczo35d/55OpqW7uhZQAe3xDDS1
eW/t5JHZmtCnAyqNgxkopB+eE+lAxkVOL+2fp+G1LMsMhjqsqxfTV2AOHTsYDx+1
a9lVRYLsw3IPHy0UA42zulpuv31I+B/19u8euud5VJMLv15QIT6UQKOXhZuoG+fW
9MdfgyBBUHMjHO7L6oX+QvgT65QfIdnlHscxzXKqxnbkBRI1dYs63WKiYC9E6QCO
/USS5aM4LbMaE7zb+9Jg1YvdjXGzCkkJ56ioljHHyanwExzcslg0ZFM4D2+sMwqx
CwoulZTPKBSYvAiDa5jRE6vKuw8qjF3hRzY9xUlJ9cXPXFE8ig==
=PmXN
-----END PGP SIGNATURE-----

--- End Message ---
_______________________________________________
devscripts-devel mailing list
[email protected]
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/devscripts-devel

Reply via email to