Bug#944964: dh-make-perl: Module accesses internal dpkg database

Guillem Jover guillem at debian.org
Tue Nov 19 00:15:52 GMT 2019


Hi!

On Mon, 2019-11-18 at 18:29:36 +0100, gregor herrmann wrote:
> On Sun, 17 Nov 2019 21:38:24 +0100, Guillem Jover wrote:
> >  [M] lib/Debian/DpkgLists.pm
> > 
> > The function _cat_lists() accesses the file list files directly, and
> > should be switched to use either «dpkg-query --listfiles» instead, or the
> > dpkg-query db-fsys:Files virtual field with --show.
> 
> Thanks for the bug report and the hint about db-fsys:Files.
> 
> I've now come up with a first patch (pushed to git) which seems to
> work and which is not terribly slow.
> 
> t/DpkgLists.t still passes and takes ~9 seconds; with the original
> _cat_lists() it was more like 2.5 seconds but well.

Hmm ouch, I didn't expect it to be that slow. I've poked a bit, and
attached are some changes I've got locally that should shave a couple
of seconds. Will keep looking for further improvements. But I guess
in the end dpkg-query is just doing more work, as it first needs to
parse the status db, build all the internal data structures, and then
build the output according to the format specified.

Maybe I need to look into making «dpkg-query --listfiles» require no
packages to dump the entire thing like in this case. But I'm not sure
how common this need is? But much of the involved work above would
still be done all the same, we'd just skip part of the formatting.

Thanks,
Guillem
-------------- next part --------------
A non-text attachment was scrubbed...
Name: dpkg-query-show-optimize.patch
Type: text/x-diff
Size: 4904 bytes
Desc: not available
URL: <http://alioth-lists.debian.net/pipermail/pkg-perl-maintainers/attachments/20191119/bcc27e20/attachment.patch>


More information about the pkg-perl-maintainers mailing list