diff options
author | David Kalnischkies <david@kalnischkies.de> | 2014-02-06 00:13:10 +0100 |
---|---|---|
committer | Michael Vogt <mvo@debian.org> | 2014-02-06 07:10:28 +0100 |
commit | 446551c8ffd2c9cb9dcd707c94590e73009f7dd9 (patch) | |
tree | c7e85ba213d319ae540ba770f2531a3d6f8b2037 /apt-pkg | |
parent | bb2e0d5add4a291f09d68ebb5588e45dc128d766 (diff) |
discard impossible candidates in MarkInstall
If a (Pre-)Depends can't be satisfied there is no point in keeping the
candidate as is as it is impossible to find a solution for it, so we can
just as well reset the candidate to the currently installed version.
We avoid trying to install this impossible candidate later on this way.
Closes: #735967
Diffstat (limited to 'apt-pkg')
-rw-r--r-- | apt-pkg/depcache.cc | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/apt-pkg/depcache.cc b/apt-pkg/depcache.cc index f9c891c86..7e75a6fe3 100644 --- a/apt-pkg/depcache.cc +++ b/apt-pkg/depcache.cc @@ -1134,8 +1134,13 @@ bool pkgDepCache::MarkInstall(PkgIterator const &Pkg,bool AutoInst, std::clog << OutputInDepth(Depth) << Start << " can't be satisfied!" << std::endl; if (Start.IsCritical() == false) continue; - // if the dependency was critical, we can't install it, so remove it again - MarkDelete(Pkg,false,Depth + 1, false); + // if the dependency was critical, we have absolutely no chance to install it, + // so if it wasn't installed remove it again. If it was, discard the candidate + // as the problemresolver will trip over it otherwise trying to install it (#735967) + if (Pkg->CurrentVer == 0) + MarkDelete(Pkg,false,Depth + 1, false); + else + SetCandidateVersion(Pkg.CurrentVer()); return false; } |