Просмотр исходного кода

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.
David Kalnischkies лет назад: 12
Родитель
Сommit
be7ce6f1d0
1 измененных файлов с 8 добавлено и 4 удалено
  1. 8 4
      apt-pkg/depcache.cc

+ 8 - 4
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() ||