]> git.saurik.com Git - apt.git/blobdiff - apt-pkg/algorithms.cc
* merged from apt--auto-mark
[apt.git] / apt-pkg / algorithms.cc
index f50c52a3297842910d60b45a661b3b00adf54583..58498aa19560f6b5993191e17b0f362834cadf58 100644 (file)
@@ -804,7 +804,7 @@ bool pkgProblemResolver::Resolve(bool BrokenFix)
            continue;
         
         if (Debug == true)
-           cout << "Investigating " << I.Name() << endl;
+           clog << "Investigating " << I.Name() << endl;
         
         // Isolate the problem dependency
         PackageKill KillList[100];
@@ -986,6 +986,7 @@ bool pkgProblemResolver::Resolve(bool BrokenFix)
                     }
                     if (Debug)
                        clog << "  Will not break " << Pkg.Name() << " as stated in Breaks field in " << I.Name() <<endl;
+                    Cache.MarkKeep(I, false, false);
                     continue;
                  }
 
@@ -1250,8 +1251,13 @@ void pkgProblemResolver::InstallProtect()
       {
         if ((Flags[I->ID] & ToRemove) == ToRemove)
            Cache.MarkDelete(I);
-        else
-           Cache.MarkInstall(I, false, 0, false);
+        else 
+        {
+           // preserver the information if the package was auto
+           // or manual installed
+           bool autoInst = (Cache[I].Flags & pkgCache::Flag::Auto);
+           Cache.MarkInstall(I, false, 0, !autoInst);
+        }
       }
    }   
 }