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

Bug#699759: apt: score computation may prefer obsolete installed packages over their successors



Followup-For: Bug #699759
Control: tag -1 patch

Hi,

I'm attaching a patch that just skips regative scores from rdeps. I
thought I sent this long ago ...
It has gotten a lot of testing for doing piuparts squeeze->wheezy
upgrades with apt/wheezy+patch (backported to squeeze). Compared to
apt/wheezy (backported to squeeze, too) this solves the score issue
for a few upgrade paths and does not introduce new problems.

This has mainly an effect on "leaf" packages with scores <= 2.
"Skewing" the score by +/- 1 makes a big difference here.

I'd like to see if this issue could be solved in an early point release
for wheezy, too, to have a more sane scoring at work for wheezy->jessie
upgrades.


Andreas
diffstat for apt-0.9.7.8 apt-0.9.7.8+nmu0

 apt-pkg/algorithms.cc   |    5 
 autom4te.cache/output.0 | 9173 ------------------------------------------------
 autom4te.cache/output.1 | 9173 ------------------------------------------------
 autom4te.cache/requests |  198 -
 autom4te.cache/traces.0 | 3482 ------------------
 autom4te.cache/traces.1 |  629 ---
 debian/changelog        |   10 
 7 files changed, 14 insertions(+), 22656 deletions(-)

diff -Nru apt-0.9.7.8/apt-pkg/algorithms.cc apt-0.9.7.8+nmu0/apt-pkg/algorithms.cc
--- apt-0.9.7.8/apt-pkg/algorithms.cc	2013-03-01 11:51:21.000000000 +0100
+++ apt-0.9.7.8+nmu0/apt-pkg/algorithms.cc	2013-04-13 22:00:51.000000000 +0200
@@ -645,7 +645,10 @@
 	      D->Type != pkgCache::Dep::Recommends))
 	    continue;	 
 	 
-	 Scores[I->ID] += abs(OldScores[D.ParentPkg()->ID]);
+	 // Do not propagate negative scores otherwise
+	 // an extra (-2) package might score better than an optional (-1)
+	 if (OldScores[D.ParentPkg()->ID] > 0)
+	     Scores[I->ID] += OldScores[D.ParentPkg()->ID];
       }      
    }
 
diff -Nru apt-0.9.7.8/autom4te.cache/output.0 apt-0.9.7.8+nmu0/autom4te.cache/output.0
diff -Nru apt-0.9.7.8/autom4te.cache/output.1 apt-0.9.7.8+nmu0/autom4te.cache/output.1
diff -Nru apt-0.9.7.8/autom4te.cache/requests apt-0.9.7.8+nmu0/autom4te.cache/requests
diff -Nru apt-0.9.7.8/autom4te.cache/traces.0 apt-0.9.7.8+nmu0/autom4te.cache/traces.0
diff -Nru apt-0.9.7.8/autom4te.cache/traces.1 apt-0.9.7.8+nmu0/autom4te.cache/traces.1
diff -Nru apt-0.9.7.8/debian/changelog apt-0.9.7.8+nmu0/debian/changelog
--- apt-0.9.7.8/debian/changelog	2013-03-14 08:14:09.000000000 +0100
+++ apt-0.9.7.8+nmu0/debian/changelog	2013-05-04 09:55:52.000000000 +0200
@@ -1,3 +1,13 @@
+apt (0.9.7.8+nmu0) UNRELEASED; urgency=low
+
+  * Non-maintainer upload.
+  * apt-pkg/algorithms.cc:
+    - Do not propagate negative scores from rdepends. Propagating the absolute
+      value of a negative score may boost obsolete packages and keep them
+      installed instead of installing their successors.  (Closes: #699759)
+
+ -- Andreas Beckmann <anbe@debian.org>  Fri, 15 Feb 2013 19:52:29 +0100
+
 apt (0.9.7.8) unstable; urgency=criticial
 
   * SECURITY UPDATE: InRelease verification bypass

Reply to: