Browse Source

Fix multi-arch support:

Temporarily revert change from 1.53:
'Find package files lists by running dpkg -L by batches.'
(dpkg -L does not provide a stable interface across upgrade).
Instead add '$package:*.list' to the list of filelists. Closes: #660712
Reject files in subdirectories of */lib/<triplet> since they are read
by ldconfig now.
suites/ascii
Bill Allombert 10 years ago
parent
commit
356e8021c8
  1. 12
      debian/changelog
  2. 70
      popularity-contest

12
debian/changelog

@ -1,3 +1,15 @@
popularity-contest (1.55) unstable; urgency=low
* popularity-contest: fix multi-arch support:
- Temporarily revert change from 1.53:
'Find package files lists by running dpkg -L by batches.'
(dpkg -L does not provide a stable interface across upgrade).
- Instead add '$package:*.list' to the list of filelists. Closes: #660712
- Reject files in subdirectories of */lib/<triplet> since they are read
by ldconfig now.
-- Bill Allombert <ballombe@debian.org> Tue, 22 May 2012 20:14:37 +0200
popularity-contest (1.54) unstable; urgency=low
[ Bill Allombert ]

70
popularity-contest

@ -96,47 +96,51 @@ while (<PACKAGES>)
{
/^.*installed *(.+)$/ or next;
my $pkg=$1;
$popcon{$pkg}=[0,0,$pkg,"<NOFILES>"];
open FILES, "$dpkg_db/$pkg.list" or
do { print STDERR "popcon: file $dpkg_db/$pkg.list is missing\n"; next; };
my $bestatime = undef;
while (<FILES>)
my $list;
$popcon{$pkg}=[0,0,$pkg,"<NOFILES>"];
foreach ("$dpkg_db/$pkg.list", glob("$dpkg_db/$pkg:*.list"))
{
chop;
next unless (
( m{/bin/|/sbin/|/lib/.+/|^/usr/games/|\.[ah]$|\.pm$|\.php$|^/boot/System\.map-}
|| defined $mapped{$_} )
&& -f $_);
my($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,
$atime,$mtime,$ctime,$blksize,$blocks)
= stat;
if (defined $mapped{$_}) {
# It's currently being accessed by a process
$atime = time();
}
print STDERR if (!defined($atime));
if (!defined($bestatime) || $atime >= $bestatime)
open FILES, $_ or next;
while (<FILES>)
{
$bestatime=$atime;
if ($atime < $lastmonth)
{
# Not accessed since more than 30 days.
$popcon{$pkg}=[$atime,$ctime,$pkg,$_,"<OLD>"];
}
elsif ($ctime > $lastmonth && $atime-$ctime < $daylen)
{
# Installed/upgraded less than a month ago and not used after
# install/upgrade day.
$popcon{$pkg}=[$atime,$ctime,$pkg,$_,"<RECENT-CTIME>"];
chop;
next unless (
( m{/bin/|/sbin/|/lib/.+/|^/usr/games/|\.[ah]$|\.pm$|\.php$|^/boot/System\.map-}
&& ! m{/lib/.+-.+-.+/}
|| defined $mapped{$_} )
&& -f $_);
my($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,
$atime,$mtime,$ctime,$blksize,$blocks)
= stat;
if (defined $mapped{$_}) {
# It's currently being accessed by a process
$atime = time();
}
else
print STDERR if (!defined($atime));
if (!defined($bestatime) || $atime >= $bestatime)
{
# Else we `vote' for the package.
$popcon{$pkg}=[$atime,$ctime,$pkg,$_];
$bestatime=$atime;
if ($atime < $lastmonth)
{
# Not accessed since more than 30 days.
$popcon{$pkg}=[$atime,$ctime,$pkg,$_,"<OLD>"];
}
elsif ($ctime > $lastmonth && $atime-$ctime < $daylen)
{
# Installed/upgraded less than a month ago and not used after
# install/upgrade day.
$popcon{$pkg}=[$atime,$ctime,$pkg,$_,"<RECENT-CTIME>"];
}
else
{
# Else we `vote' for the package.
$popcon{$pkg}=[$atime,$ctime,$pkg,$_];
}
}
}
close FILES;
}
close FILES;
}
close PACKAGES;

Loading…
Cancel
Save