summaryrefslogtreecommitdiff
path: root/apt-pkg/depcache.cc
diff options
context:
space:
mode:
authorDavid Kalnischkies <david@kalnischkies.de>2020-04-26 13:11:31 +0200
committerDavid Kalnischkies <david@kalnischkies.de>2020-04-27 13:45:59 +0200
commit0de399391372450d0162b5a09bfca554b2d27c3d (patch)
treeb2f0f86e0196fa4eaf63f540c418bc4367113ec2 /apt-pkg/depcache.cc
parent924704ba1dc13f73edb0db6c3c8c07ccf0ec26b6 (diff)
Discard candidate if its dependencies can't be satisfied
We do pretty much the same in IsInstallOk, but here we have already set the state, so we have to unroll the state as well to sort-of replicate the state we were in before this MarkInstall failed.
Diffstat (limited to 'apt-pkg/depcache.cc')
-rw-r--r--apt-pkg/depcache.cc17
1 files changed, 17 insertions, 0 deletions
diff --git a/apt-pkg/depcache.cc b/apt-pkg/depcache.cc
index cd5558461..425918b43 100644
--- a/apt-pkg/depcache.cc
+++ b/apt-pkg/depcache.cc
@@ -1324,7 +1324,24 @@ bool pkgDepCache::MarkInstall(PkgIterator const &Pkg,bool AutoInst,
break;
} while (Start++ != End);
if (not foundSolution && End.IsCritical())
+ {
+ StateCache &State = PkgState[Pkg->ID];
+ if (not State.Protect())
+ {
+ RemoveSizes(Pkg);
+ RemoveStates(Pkg);
+ if (Pkg->CurrentVer != 0)
+ State.InstallVer = State.CandidateVer = Pkg.CurrentVer();
+ else
+ State.InstallVer = State.CandidateVer = nullptr;
+ State.Mode = ModeKeep;
+ State.Update(Pkg, *this);
+ AddStates(Pkg);
+ Update(Pkg);
+ AddSizes(Pkg);
+ }
return false;
+ }
}
toInstall.clear();