From dec5b117052b77e4366efd8234e0cec09989b700 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Wed, 8 May 2013 17:46:31 +0200 Subject: * 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) --- apt-pkg/algorithms.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'apt-pkg/algorithms.cc') diff --git a/apt-pkg/algorithms.cc b/apt-pkg/algorithms.cc index 8cd9d4c6e..991d425e3 100644 --- a/apt-pkg/algorithms.cc +++ b/apt-pkg/algorithms.cc @@ -645,7 +645,10 @@ void pkgProblemResolver::MakeScores() 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]; } } -- cgit v1.2.3 From f3c736f9b6fdef1d8045846c465d675858eb1471 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Fri, 24 May 2013 10:20:38 +0200 Subject: deprecate InstallProtect as a cpu-eating no-op In the past packages were flagged "Protected" so that install/ remove markings where issued before the ProblemResolver. Nowadays, the marking methods check if they are allowed to modify the marking of a package instead, so that markings set by FromUser calls are not overwritten anymore by automatic calls which elimates the need for InstallProtect which just eats CPU now. The method itself is left untouched for now in case frontend needs it still for some wierd usecase, but they should be eliminated. --- apt-pkg/algorithms.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'apt-pkg/algorithms.cc') diff --git a/apt-pkg/algorithms.cc b/apt-pkg/algorithms.cc index 6cde4d6cc..d19783983 100644 --- a/apt-pkg/algorithms.cc +++ b/apt-pkg/algorithms.cc @@ -1440,9 +1440,11 @@ bool pkgProblemResolver::ResolveByKeepInternal() return true; } /*}}}*/ -// ProblemResolver::InstallProtect - Install all protected packages /*{{{*/ +// ProblemResolver::InstallProtect - deprecated cpu-eating no-op /*{{{*/ // --------------------------------------------------------------------- -/* This is used to make sure protected packages are installed */ +/* Actions issued with FromUser bit set are protected from further + modification (expect by other calls with FromUser set) nowadays , so we + don't need to reissue actions here, they are already set in stone. */ void pkgProblemResolver::InstallProtect() { pkgDepCache::ActionGroup group(Cache); -- cgit v1.2.3 From 32b5dd08ac22b0ad153b145d1500c66fe4c78f83 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Thu, 27 Jun 2013 07:25:53 +0200 Subject: show broken count when starting the resolver --- apt-pkg/algorithms.cc | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'apt-pkg/algorithms.cc') diff --git a/apt-pkg/algorithms.cc b/apt-pkg/algorithms.cc index 6cde4d6cc..b08b8dcfc 100644 --- a/apt-pkg/algorithms.cc +++ b/apt-pkg/algorithms.cc @@ -845,8 +845,10 @@ bool pkgProblemResolver::ResolveInternal(bool const BrokenFix) } while (Again == true); - if (Debug == true) + if (Debug == true) { clog << "Starting" << endl; + clog << " Broken count: " << Cache.BrokenCount() << endl; + } MakeScores(); @@ -874,8 +876,10 @@ bool pkgProblemResolver::ResolveInternal(bool const BrokenFix) } } - if (Debug == true) + if (Debug == true) { clog << "Starting 2" << endl; + clog << " Broken count: " << Cache.BrokenCount() << endl; + } /* Now consider all broken packages. For each broken package we either remove the package or fix it's problem. We do this once, it should -- cgit v1.2.3 From dcab2a78e1585903ff144949f40c514788638f92 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Thu, 27 Jun 2013 10:27:29 +0200 Subject: use just one line for the debug output (thanks to donkult for the review) --- apt-pkg/algorithms.cc | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'apt-pkg/algorithms.cc') diff --git a/apt-pkg/algorithms.cc b/apt-pkg/algorithms.cc index b08b8dcfc..c2c38e728 100644 --- a/apt-pkg/algorithms.cc +++ b/apt-pkg/algorithms.cc @@ -846,8 +846,7 @@ bool pkgProblemResolver::ResolveInternal(bool const BrokenFix) while (Again == true); if (Debug == true) { - clog << "Starting" << endl; - clog << " Broken count: " << Cache.BrokenCount() << endl; + clog << "Starting, broken count: " << Cache.BrokenCount() << endl; } MakeScores(); @@ -877,8 +876,7 @@ bool pkgProblemResolver::ResolveInternal(bool const BrokenFix) } if (Debug == true) { - clog << "Starting 2" << endl; - clog << " Broken count: " << Cache.BrokenCount() << endl; + clog << "Starting 2, broken count: " << Cache.BrokenCount() << endl; } /* Now consider all broken packages. For each broken package we either -- cgit v1.2.3 From 49b49018ff08e337c506d5ccb3476bc2faa5d1b5 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Fri, 28 Jun 2013 07:37:55 +0200 Subject: make starting debug output of pkgProblemResolver proper english --- apt-pkg/algorithms.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'apt-pkg/algorithms.cc') diff --git a/apt-pkg/algorithms.cc b/apt-pkg/algorithms.cc index c2c38e728..df38e6109 100644 --- a/apt-pkg/algorithms.cc +++ b/apt-pkg/algorithms.cc @@ -846,7 +846,8 @@ bool pkgProblemResolver::ResolveInternal(bool const BrokenFix) while (Again == true); if (Debug == true) { - clog << "Starting, broken count: " << Cache.BrokenCount() << endl; + clog << "Starting pkgProblemResolver with broken count: " + << Cache.BrokenCount() << endl; } MakeScores(); @@ -876,7 +877,8 @@ bool pkgProblemResolver::ResolveInternal(bool const BrokenFix) } if (Debug == true) { - clog << "Starting 2, broken count: " << Cache.BrokenCount() << endl; + clog << "Starting 2 pkgProblemResolver with broken count: " + << Cache.BrokenCount() << endl; } /* Now consider all broken packages. For each broken package we either -- cgit v1.2.3