diff options
author | Michael Vogt <michael.vogt@ubuntu.com> | 2010-08-31 12:27:39 +0200 |
---|---|---|
committer | Michael Vogt <michael.vogt@ubuntu.com> | 2010-08-31 12:27:39 +0200 |
commit | 4429616bd6b13499981da3d7d542f71e4f3ece8c (patch) | |
tree | 022af4c899e41935cdfb59ef0ebdbc35094ebba0 /apt-pkg/algorithms.cc | |
parent | 2d865c7db248d6eab1ba332a79f1a38b764f8c72 (diff) |
apt-pkg/algorithms.cc: in the case of conflicts/breaks against a Provide Start.AllTarget() returns all non-canidates as well, we want to filter them out
Diffstat (limited to 'apt-pkg/algorithms.cc')
-rw-r--r-- | apt-pkg/algorithms.cc | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/apt-pkg/algorithms.cc b/apt-pkg/algorithms.cc index 3c8711b74..a46dce2db 100644 --- a/apt-pkg/algorithms.cc +++ b/apt-pkg/algorithms.cc @@ -987,6 +987,23 @@ bool pkgProblemResolver::Resolve(bool BrokenFix) pkgCache::VerIterator Ver(Cache,*V); pkgCache::PkgIterator Pkg = Ver.ParentPkg(); + /* Ignore a target that is not a candidate + This can happen if: + installed package provides video-6 + candidate provides video-8 + now if a package Start breaks/conflicts video-6 + Start.AllTargets() will return the now-installed + versions even though these are not candidates + we can ignore them + */ + if (Cache[Pkg].CandidateVerIter(Cache) != Ver) + { + clog << " Version " << Ver.VerStr() << " for " + << Pkg.Name() << " is not a candidate, ignoring" + << endl; + continue; + } + if (Debug == true) clog << " Considering " << Pkg.FullName(false) << ' ' << (int)Scores[Pkg->ID] << " as a solution to " << I.FullName(false) << ' ' << (int)Scores[I->ID] << endl; |