[Git][reproducible-builds/diffoscope][master] Ensure Debian substvar generation is deterministic regardless of installed…

Chris Lamb gitlab at salsa.debian.org
Mon Sep 10 20:07:14 CEST 2018


Chris Lamb pushed to branch master at Reproducible Builds / diffoscope


Commits:
889e4bf7 by Chris Lamb at 2018-09-10T18:07:02Z
Ensure Debian substvar generation is deterministic regardless of installed packages. (Closes: #908072)

- - - - -


1 changed file:

- diffoscope/main.py


Changes:

=====================================
diffoscope/main.py
=====================================
@@ -330,11 +330,20 @@ class ListToolsAction(argparse.Action):
 
 class ListDebianSubstvarsAction(argparse._StoreTrueAction):
     def __call__(self, *args, **kwargs):
-        # Ensure all comparators are imported so tool_required.all is
-        # populated.
+        # Attempt to import all comparators so tool_required.all is as
+        # populated as possible...
         ComparatorManager().reload()
 
-        tools = tool_required.all
+        # ... however for the generated substvar to be effective/deterministic
+        # regardless of the currently installed packages we special-case some
+        # tools (NB. not package names) as their modules may not have been
+        # imported by the `ComparatorManager().reload()` call above. (#908072)
+        tools = set((
+            'gpg',  # comparators/debian.py
+            'rpm2cpio',  # comparators/rpm.py
+        ))
+        tools.update(tool_required.all)
+
         packages = set()
         for x in tools:
             try:



View it on GitLab: https://salsa.debian.org/reproducible-builds/diffoscope/commit/889e4bf7394d465ae2c9a17a0661bb401c30f54a

-- 
View it on GitLab: https://salsa.debian.org/reproducible-builds/diffoscope/commit/889e4bf7394d465ae2c9a17a0661bb401c30f54a
You're receiving this email because of your account on salsa.debian.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.reproducible-builds.org/pipermail/rb-commits/attachments/20180910/0924dea5/attachment.html>


More information about the rb-commits mailing list