]> git.saurik.com Git - apt.git/blobdiff - apt-pkg/algorithms.cc
Start on acquire stuff
[apt.git] / apt-pkg / algorithms.cc
index 126318b59a8f265c8d107cefd1ab801113312876..755474e151c0920eb4ee5b9f0db00ac2302ef185 100644 (file)
@@ -1,6 +1,6 @@
 // -*- mode: cpp; mode: fold -*-
 // Description                                                         /*{{{*/
-// $Id: algorithms.cc,v 1.5 1998/10/08 04:54:58 jgg Exp $
+// $Id: algorithms.cc,v 1.6 1998/10/20 02:39:17 jgg Exp $
 /* ######################################################################
 
    Algorithms - A set of misc algorithms
@@ -713,7 +713,7 @@ bool pkgProblemResolver::Resolve(bool BrokenFix)
                   ((Cache[End] & pkgDepCache::DepGNow) == 0 &&
                    End->Type != pkgCache::Dep::Conflicts))
               {
-                 if ((Flags[I->ID] & Protected) != 0)
+                 if ((Flags[I->ID] & Protected) == Protected)
                     continue;
 
                  // See if a keep will do
@@ -755,7 +755,8 @@ bool pkgProblemResolver::Resolve(bool BrokenFix)
            }
 
            // Hm, nothing can possibly satisify this dep. Nuke it.
-           if (VList[0] == 0 && End->Type != pkgCache::Dep::Conflicts)
+           if (VList[0] == 0 && End->Type != pkgCache::Dep::Conflicts &&
+               (Flags[I->ID] & Protected) != Protected)
            {
               Cache.MarkKeep(I);
               if (Cache[I].InstBroken() == false)
@@ -942,3 +943,20 @@ bool pkgProblemResolver::ResolveByKeep()
    return true;
 }
                                                                        /*}}}*/
+// ProblemResolver::InstallProtect - Install all protected packages    /*{{{*/
+// ---------------------------------------------------------------------
+/* This is used to make sure protected packages are installed */
+void pkgProblemResolver::InstallProtect()
+{
+   for (pkgCache::PkgIterator I = Cache.PkgBegin(); I.end() == false; I++)
+   {
+      if ((Flags[I->ID] & Protected) == Protected)
+      {
+        if ((Flags[I->ID] & ToRemove) == ToRemove)
+           Cache.MarkDelete(I);
+        else
+           Cache.MarkInstall(I,false);
+      }
+   }   
+}
+                                                                       /*}}}*/