]> git.saurik.com Git - apt.git/commitdiff
set hint flags for the problem resolver according to request
authorDavid Kalnischkies <kalnischkies@gmail.com>
Tue, 19 Apr 2011 09:52:47 +0000 (11:52 +0200)
committerDavid Kalnischkies <kalnischkies@gmail.com>
Tue, 19 Apr 2011 09:52:47 +0000 (11:52 +0200)
cmdline/apt-internal-solver.cc

index 83d79e42a54cf2420626e4f19db242df5c57657e..83a671a9607ec9bb36797011d39e09f0c887ed22 100644 (file)
@@ -104,11 +104,28 @@ int main(int argc,const char *argv[])                                     /*{{{*/
                std::cerr << "Failed to apply request to depcache!" << std::endl;
                return 3;
        }
+
+       pkgProblemResolver Fix(CacheFile);
+       for (std::list<std::string>::const_iterator i = remove.begin();
+            i != remove.end(); ++i) {
+               pkgCache::PkgIterator P = CacheFile->FindPkg(*i);
+               Fix.Clear(P);
+               Fix.Protect(P);
+               Fix.Remove(P);
+       }
+
+       for (std::list<std::string>::const_iterator i = install.begin();
+            i != install.end(); ++i) {
+               pkgCache::PkgIterator P = CacheFile->FindPkg(*i);
+               Fix.Clear(P);
+               Fix.Protect(P);
+       }
+
        for (std::list<std::string>::const_iterator i = install.begin();
             i != install.end(); ++i)
                CacheFile->MarkInstall(CacheFile->FindPkg(*i), true);
 
-       pkgProblemResolver Fix(CacheFile);
+
        if (Fix.Resolve() == false) {
                EDSP::WriteError("An error occured", output);
                return 0;