summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Kalnischkies <david@kalnischkies.de>2014-03-11 15:32:40 +0100
committerDavid Kalnischkies <david@kalnischkies.de>2014-03-23 12:31:02 +0100
commitbe7ce6f1d067fa62b01685e48094f3f73c95189f (patch)
tree4b5238d3780ca97bc38be550c8a5ff610ce934a3
parentd3d9e102c0eb169cb9ab3ad18b07f5a03bf0598d (diff)
do IsInstallOk call in MarkInstall unconditionally
Hooked checks could be influenced by AutoInst as a lot can happen between a call without and one with this bit set. The real cache-hit check is above this call already. Individual hooked checks can then inspect the state if they want to cache. Calling them multiple times shouldn't be a problem either way.
-rw-r--r--apt-pkg/depcache.cc12
1 files changed, 8 insertions, 4 deletions
diff --git a/apt-pkg/depcache.cc b/apt-pkg/depcache.cc
index e2c412757..5fa88a5d2 100644
--- a/apt-pkg/depcache.cc
+++ b/apt-pkg/depcache.cc
@@ -1059,10 +1059,9 @@ bool pkgDepCache::MarkInstall(PkgIterator const &Pkg,bool AutoInst,
return true;
}
- // check if we are allowed to install the package (if we haven't already)
- if (P.Mode != ModeInstall || P.InstallVer != P.CandidateVer)
- if (IsInstallOk(Pkg,AutoInst,Depth,FromUser) == false)
- return false;
+ // check if we are allowed to install the package
+ if (IsInstallOk(Pkg,AutoInst,Depth,FromUser) == false)
+ return false;
ActionGroup group(*this);
P.iFlags &= ~AutoKept;
@@ -1308,6 +1307,11 @@ bool pkgDepCache::IsInstallOkMultiArchSameVersionSynced(PkgIterator const &Pkg,
if (FromUser == true) // as always: user is always right
return true;
+ // if we have checked before and it was okay, it will still be okay
+ if (PkgState[Pkg->ID].Mode == ModeInstall &&
+ PkgState[Pkg->ID].InstallVer == PkgState[Pkg->ID].CandidateVer)
+ return true;
+
// ignore packages with none-M-A:same candidates
VerIterator const CandVer = PkgState[Pkg->ID].CandidateVerIter(*this);
if (unlikely(CandVer.end() == true) || CandVer == Pkg.CurrentVer() ||