summaryrefslogtreecommitdiff
path: root/apt-pkg/depcache.cc
diff options
context:
space:
mode:
authorDavid Kalnischkies <david@kalnischkies.de>2020-05-23 15:53:06 +0200
committerDavid Kalnischkies <david@kalnischkies.de>2020-05-23 17:59:19 +0200
commit4f71dc657c34915508a9e34b000e1b577931655a (patch)
tree0e674c8abd70813755ec0dc6ca985c0985fa2a2c /apt-pkg/depcache.cc
parent4d87856b94dae1a40a1a8147a6dbcfe714cd05c7 (diff)
Keep status number if candidate is discarded for kept back display
It looks like hack and therefore I wanted this to be a very isolated commit so we can find it & revert it easily if need be, but for now it seems to work. The idea is that Status is telling us how the candidate is in relation to the current installed version which is used to figure out if a package is "kept back" by the algorithm or not, but by discarding the candidate version we loose this information. Ideally we would keep better tabs on what we do to a package and why, but for now that seems okayish. It will cause the wrong version to be displayed though as if the package is installed the installed version becomes the candidate and hence (installed => installed) is displayed.
Diffstat (limited to 'apt-pkg/depcache.cc')
-rw-r--r--apt-pkg/depcache.cc2
1 files changed, 2 insertions, 0 deletions
diff --git a/apt-pkg/depcache.cc b/apt-pkg/depcache.cc
index 39e30a38d..fa0bd8ed5 100644
--- a/apt-pkg/depcache.cc
+++ b/apt-pkg/depcache.cc
@@ -1115,7 +1115,9 @@ static bool MarkInstall_DiscardCandidate(pkgDepCache &Cache, pkgCache::PkgIterat
{
auto &State = Cache[Pkg];
State.CandidateVer = State.InstallVer;
+ auto const oldStatus = State.Status;
State.Update(Pkg, Cache);
+ State.Status = oldStatus;
return true;
}
/*}}}*/