Bug#657695: apt: gives up too easily when resolving Breaks of virtual packages
Usertags: origin-ubuntu ubuntu-patch precise
If a package Breaks a virtual package with many providers, and the
appropriate resolver action is to remove several of those providers,
then the resolver goes round one iteration of its master loop - which
has a hard limit of 10 iterations, so they are in short supply - per
provider. This is not the case for Conflicts, where it deals with all
the providers in a single iteration of the master loop.
There seems no obvious reason for this discrepancy, and I think it was
an oversight when Breaks support was introduced in apt.
An example of a failed upgrade resolution due to this bug is here:
You can see it working its way through xserver-xorg-core's Breaks on
xserver-xorg-video-6 one package at a time and eventually running out of
iterations, when it would have succeeded if it had got round to
processing all the providers.
The following patch fixes this:
=== modified file 'apt-pkg/algorithms.cc'
--- apt-pkg/algorithms.cc 2011-11-10 15:56:21 +0000
+++ apt-pkg/algorithms.cc 2012-01-28 01:44:53 +0000
@@ -1098,8 +1098,7 @@ bool pkgProblemResolver::ResolveInternal
LEnd->Dep = End;
- if (Start->Type != pkgCache::Dep::Conflicts &&
- Start->Type != pkgCache::Dep::Obsoletes)
+ if (Start.IsNegative() == false)
Colin Watson [email@example.com]