Bug#913781: reprozip: Script accesses internal dpkg database
Guillem Jover
guillem at debian.org
Fri Nov 16 02:39:14 GMT 2018
Hi!
On Thu, 2018-11-15 at 00:37:10 -0500, Rémi Rampin wrote:
> Upstream developer here. ReproZip needs to match from filename to package,
> not the other way around. It formerly used `dpkg-query -S FILENAME` to do
> this, but this was switched to reading the database directly for
> performance reasons (exact commit is
> https://github.com/ViDA-NYU/reprozip/commit/b085c41035959a451d77b0defa8c8b4ba025f47e).
> When many files need to be looked up, it is more efficient to do a single
> read through the info/*.list files than to do many such queries.
Ah right sorry, read that code sideways.
> If I am missing a fast way to do this using the correct external interface,
> please let me know, and I will gladly update the code.
The same principle I proposed for --listfiles can be used for --search,
you'd just batch as many filenames as can possibly fit within the
command-line length limit (ARG_MAX - environment length) to reduce as
many dpkg-query calls as possible. Doing a «dpkg-query --search» call
per filename will indeed end up being very expensive.
Thanks,
Guillem
More information about the debian-science-maintainers
mailing list