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

Bug#699298: apt: pkgProblemResolver::ShowScores does not list packages with a score of 0



Package: apt
Version: 0.8.10.3+squeeze1
Severity: important

Hi,

while trying to debug some squeeze2wheezy distupgrade problems (packages
being kept at the squeeze version instead of removing something
obsolete), I noticed the output from
Debug::pkgProblemResolver::ShowScores is missing some relevant packages:
those with a score of 0. From a rather random logfile (full log
attached):

  1 libsigsegv2 [ amd64 ] < none -> 2.9-4 > ( libs )
  1 krb5-locales [ amd64 ] < none -> 1.10.1+dfsg-3 > ( localization )
  1 libdb4.7 [ amd64 ] < 4.7.25-9 > ( libs )
  1 libdb4.8 [ amd64 ] < 4.8.30-2 > ( libs )
  1 gnupg-curl [ amd64 ] < none -> 1.4.12-7 > ( utils )
  1 rsyslog [ amd64 ] < none -> 5.8.11-2 > ( admin )
  1 libsasl2-modules [ amd64 ] < none -> 2.1.25.dfsg1-6 > ( libs )
  1 iptables [ amd64 ] < none -> 1.4.14-3 > ( net )
  -1 makedev [ amd64 ] < 2.3.1-89 -> 2.3.1-92 > ( admin )
  -1 libperl5.10 [ amd64 ] < 5.10.1-17squeeze3 > ( libs )
  Starting 2
  Investigating (0) resource-agents [ amd64 ] < none -> 1:3.9.2-5+deb7u1 > ( admin )
  Broken resource-agents:amd64 Conflicts on cluster-agents [ amd64 ] < 1:1.0.3-3.1 -> 1:1.0.3-4 > ( admin ) (<= 1:1.0.4-1)
    Considering cluster-agents:amd64 0 as a solution to resource-agents:amd64 0
    Holding Back resource-agents:amd64 rather than change cluster-agents:amd64
  Investigating (0) heartbeat [ amd64 ] < 1:3.0.3-2 -> 1:3.0.5-3 > ( admin )
  Broken heartbeat:amd64 Depends on resource-agents [ amd64 ] < none -> 1:3.9.2-5+deb7u1 > ( admin )
    Considering resource-agents:amd64 0 as a solution to heartbeat:amd64 0
    Holding Back heartbeat:amd64 rather than change resource-agents:amd64
  Investigating (0) libperl5.10 [ amd64 ] < 5.10.1-17squeeze3 > ( libs )
  Broken libperl5.10:amd64 Depends on perl-base [ amd64 ] < 5.10.1-17squeeze3 -> 5.14.2-16 > ( perl ) (= 5.10.1-17squeeze3)
    Considering perl-base:amd64 5150 as a solution to libperl5.10:amd64 -1
    Removing libperl5.10:amd64 rather than change perl-base:amd64
   Try to Re-Instate (1) heartbeat:amd64
  Done
  The following packages will be REMOVED:
    libperl5.10
  The following NEW packages will be installed:

heartbeat and resource-agents are bot not listed in the score output,
from the problemresolver output I conclude they have a score of 0.

Looking at apt's source code I see this in algorithms.cc:

   if (_config->FindB("Debug::pkgProblemResolver::ShowScores",false) == true)
   {
      clog << "Show Scores" << endl;
      for (pkgCache::Package **K = PList; K != PEnd; K++)
         if (Scores[(*K)->ID] != 0)  // <<<=== ***
         {
           pkgCache::PkgIterator Pkg(Cache,*K);
           clog << Scores[(*K)->ID] << ' ' << Pkg << std::endl;
         }
   }

so the problem seems to exist still in the current version.

There may be a legitimate reason not to show score 0 if this would list
the other 35000 packages that were not even considered by apt ... but
also for the non-0 scores there seem to be only the "interesting" aka
considered packages to be listed.
Also no uninstalled package can have a score of 0 by default if I
understand the scoring correctly:

  Settings used to calculate pkgProblemResolver::Scores::
    Important => 3
    Required => 2
    Standard => 1
    Optional => -1
    Extra => -2
    Essentials => 100
    InstalledAndNotObsolete => 1
    Depends => 1
    Recommends => 1
    AddProtected => 10000
    AddEssential => 5000

For heartbeat and resource-agents I would compute
heartbeat:       Optional (= -1) + InstalledAndNotObsolete (= 1) = 0
resource-agents: Optional (= -1) + Depends (= 1) * 1 (heartbeat) = 0


Andreas

PS: I'd like to have a patch for squeeze's apt s.t. I can rebuild it
locally and use this in the squeeze chroot to get more correct debug
output (and no, I don't want anything that decides differently that
squeeze's apt)

Attachment: heartbeat_1:3.0.5-3.log.gz
Description: GNU Zip compressed data


Reply to: