Bug#908072: diffoscope: `bin/diffoscope --list-debian-substvars` output depends on installed packages
lamby at debian.org
Thu Sep 6 11:57:37 BST 2018
> In particular, it seems "gnupg" and "rpm2cpio" are not printed if they
> are not installed.
This is due to:
* The @tool_required decorator adds all tool names that were passed to
it to a global variable at module import time (NB. not execution
time; decorators are executed at import time)
* Our substvar generation then loops over this global variable.
* Therefore if a module is is never fully imported then the
@tool_required will not be encountered.
The following is from diffoscope/comparators/rpm.py. As the "import
rpm" will fail if python3-rpm is not installed, the @tool_required will
not be imported.
def extract(self, member_name, dest_dir):
Ideas? Hard-code the additions of gnupg or rpm2cpio in
ListDebianSubstvarsAction? Perhaps it would be cleaner to add some
explicit call in the RPM comparator, for example:
- import rpm
+ import rpm
+ except ImportError:
+ tool_required.all.add('rpm2cpio') # lol hack
… but this is not terribly nice in itself.
: :' : Chris Lamb
`. `'` lamby at debian.org / chris-lamb.co.uk
More information about the Reproducible-builds