On Sun, Feb 10, 2019 at 10:38:37AM +0100, Benoît Dejean wrote: > On Sun, Jan 27, 2019 at 01:19:26PM +0100, Bill Allombert wrote: > > On Thu, Dec 27, 2018 at 11:19:45PM +0100, Benoît wrote: > > > Package: popularity-contest > > > Version: 1.67 > > > Severity: minor > > > Tags: patch > > > > > > Dear Maintainer, > > > > > > For each installed packages, popcon globs the complete list of files > > > in /var/lib/dpkg/info. > > > This is very slow as I noticed that popcon takes more than a minute of CPU > > > time on my modest laptop, which is enough to start the fan. > > > > > > I'm attaching a patch that lists only once /var/lib/dpkg/info and > > > associates > > > each .list file with a package. > > > > > > I don't see any difference in /usr/sbin/popularity-contest output. > > > And the CPU time goes from 1min08s to 0min14s. > > > > Hello Benoît, > > > > Thanks for your patch! > > > > I tried it and it output warnings for multiarch packages which have both > > a amd64.list and a i386.list like > > > > /var/lib/dpkg/info/gcc-4.8-base:amd64.list > > /var/lib/dpkg/info/gcc-4.8-base:i386.list > > > > I get: > > Use of uninitialized value $_ in open at ./popularity-contest line 146, > > <PACKAGES> line 285. > > > > Do you understand what happen ? > > > > Not really. > But I can see that multiarch packages are processed several times. > And the part i don't understand is that processing one deletes it's files > list, hence the undef. > > Adding a simple check solves this.
Indeed this new patch do not produce warnings. Thanks! -- Bill. <[email protected]> Imagine a large red swirl here.

