do not revert candidate for protected packages
[ntk/apt.git] / apt-pkg / depcache.cc
index aa96ac5..c25672d 100644 (file)
@@ -1374,7 +1374,7 @@ bool pkgDepCache::IsInstallOkDependenciesSatisfiableByCandidates(PkgIterator con
 
         // the dependency is critical, but can't be installed, so discard the candidate
         // as the problemresolver will trip over it otherwise trying to install it (#735967)
-        if (Pkg->CurrentVer != 0)
+        if (Pkg->CurrentVer != 0 && (PkgState[Pkg->ID].iFlags & Protected) != Protected)
            SetCandidateVersion(Pkg.CurrentVer());
         return false;
       }