[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Bug#622322: popularity-contest: popcon tries to access dpkg internal files and fails with multiarch: same packageso

On Tue, Apr 12, 2011 at 11:06:26PM +0200, Raphael Hertzog wrote:
> Hi,
> On Tue, 12 Apr 2011, Bill Allombert wrote:
> > > We deliberately skip .list as we don't guarantee that we're always going
> > > to use .list and there's no guaranty that the format of the file won't be
> > > extended to store more information. You should not read those files
> > > directly.
> > 
> > Hello Raphael,
> > I have a hard time identifying what you mean by 'we' and 'you' in the above sentences.
> we = the dpkg developers
> you = popcon / the popcon maintainer who controls the code in popcon
> > I do not read these file. This is what the script popularity-contest do and have
> > done since well before I was the maintainer of popcon or you the maintainer of dpkg. 
> This doesn't make it any less wrong.

But that means I did not do anything wrong, and also that maybe it was not
wrong by the standard of the dpkg maintainers of the time.

And saying that it is wrong does not provide any help.

On my system with 1200 packages (far below the average popcon submitter),
traditional popcon take 2s.  Once patched with the attached patch to use dpkg -L, 
it take 30s.  Slowing down 15 times popcon is not acceptable.

Bill. <ballombe@debian.org>

Imagine a large red swirl here. 
Index: popularity-contest
--- popularity-contest	(révision 641)
+++ popularity-contest	(copie de travail)
@@ -99,7 +99,7 @@
   /^.*installed *(.+)$/ or next;
   my $pkg=$1;
-  open FILES, "$dpkg_db/$pkg.list" or 
+  open FILES, "-|", "dpkg -L $pkg" or 
     do { print STDERR "popcon: file $dpkg_db/$pkg.list is missing\n"; next; };
   my $bestatime = undef;
   while (<FILES>)

Reply to: