diff options
author | Michael Vogt <michael.vogt@ubuntu.com> | 2010-09-15 19:51:07 +0200 |
---|---|---|
committer | Michael Vogt <michael.vogt@ubuntu.com> | 2010-09-15 19:51:07 +0200 |
commit | 60e1c2ad73e7d62b43f1ae66a05f750ab5c8da81 (patch) | |
tree | 13814c3aea3b85516ae6ed7d08033fb6667544dc /apt-pkg/algorithms.cc | |
parent | 2d6edfef307079c94083ec03990ef65709ad588a (diff) | |
parent | 9976f17c87a6be4b27cb3fcfa59a2a7387aed5e5 (diff) |
merged lp:~mvo/apt/conflicts-on-virtuals to better deal
with conflicts/breaks against virtual packages (LP: #614993)
Diffstat (limited to 'apt-pkg/algorithms.cc')
-rw-r--r-- | apt-pkg/algorithms.cc | 29 |
1 files changed, 19 insertions, 10 deletions
diff --git a/apt-pkg/algorithms.cc b/apt-pkg/algorithms.cc index 3c8711b74..961f5c2fa 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(); + /* This is a conflicts, and the version we are looking + at is not the currently selected version of the + package, which means it is not necessary to + remove/keep */ + if (Cache[Pkg].InstallVer != Ver && + (Start->Type == pkgCache::Dep::Conflicts || + Start->Type == pkgCache::Dep::DpkgBreaks || + Start->Type == pkgCache::Dep::Obsoletes)) + { + if (Debug) + clog << " Conflicts//Breaks against version " + << Ver.VerStr() << " for " << Pkg.Name() + << " but that is not InstVer, 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; @@ -1069,22 +1086,14 @@ bool pkgProblemResolver::Resolve(bool BrokenFix) } else { - /* This is a conflicts, and the version we are looking - at is not the currently selected version of the - package, which means it is not necessary to - remove/keep */ - if (Cache[Pkg].InstallVer != Ver && - (Start->Type == pkgCache::Dep::Conflicts || - Start->Type == pkgCache::Dep::Obsoletes)) - continue; - if (Start->Type == pkgCache::Dep::DpkgBreaks) { // first, try upgradring the package, if that // does not help, the breaks goes onto the // kill list + // // FIXME: use DoUpgrade(Pkg) instead? - if (Cache[End] & pkgDepCache::DepGCVer) + if (Cache[End] & pkgDepCache::DepGCVer) { if (Debug) clog << " Upgrading " << Pkg.FullName(false) << " due to Breaks field in " << I.FullName(false) << endl; |