]> git.saurik.com Git - apt.git/blobdiff - apt-pkg/algorithms.cc
implement correct error reporting
[apt.git] / apt-pkg / algorithms.cc
index aabb511a29a64e5c12433ca1f3b6e9c641885131..5d9fefaa670f3fbe937c9227c0101665192358d3 100644 (file)
@@ -332,6 +332,10 @@ bool pkgFixBroken(pkgDepCache &Cache)
  */
 bool pkgDistUpgrade(pkgDepCache &Cache)
 {
+   std::string const solver = _config->Find("APT::Solver::Name", "internal");
+   if (solver != "internal")
+      return EDSP::ResolveExternal(solver.c_str(), Cache, false, true, false);
+
    pkgDepCache::ActionGroup group(Cache);
 
    /* Upgrade all installed packages first without autoinst to help the resolver
@@ -384,6 +388,10 @@ bool pkgDistUpgrade(pkgDepCache &Cache)
    to install packages not marked for install */
 bool pkgAllUpgrade(pkgDepCache &Cache)
 {
+   std::string const solver = _config->Find("APT::Solver::Name", "internal");
+   if (solver != "internal")
+      return EDSP::ResolveExternal(solver.c_str(), Cache, true, false, false);
+
    pkgDepCache::ActionGroup group(Cache);
 
    pkgProblemResolver Fix(&Cache);
@@ -741,18 +749,7 @@ bool pkgProblemResolver::Resolve(bool BrokenFix)
 {
    std::string const solver = _config->Find("APT::Solver::Name", "internal");
    if (solver != "internal")
-   {
-      FILE* output = fopen("/tmp/scenario.log", "w");
-      EDSP::WriteRequest(Cache, output);
-      EDSP::WriteScenario(Cache, output);
-      fclose(output);
-      if (ResolveInternal(BrokenFix) == false)
-        return false;
-      output = fopen("/tmp/solution.log", "w");
-      EDSP::WriteSolution(Cache, output);
-      fclose(output);
-      return true;
-   }
+      return EDSP::ResolveExternal(solver.c_str(), Cache, false, false, false);
    return ResolveInternal(BrokenFix);
 }
                                                                        /*}}}*/
@@ -1224,6 +1221,19 @@ bool pkgProblemResolver::ResolveInternal(bool const BrokenFix)
    in that it does not install or remove any packages. It is assumed that the
    system was non-broken previously. */
 bool pkgProblemResolver::ResolveByKeep()
+{
+   std::string const solver = _config->Find("APT::Solver::Name", "internal");
+   if (solver != "internal")
+      return EDSP::ResolveExternal(solver.c_str(), Cache, true, false, false);
+   return ResolveByKeepInternal();
+}
+                                                                       /*}}}*/
+// ProblemResolver::ResolveByKeepInternal - Resolve problems using keep        /*{{{*/
+// ---------------------------------------------------------------------
+/* This is the work horse of the soft upgrade routine. It is very gental
+   in that it does not install or remove any packages. It is assumed that the
+   system was non-broken previously. */
+bool pkgProblemResolver::ResolveByKeepInternal()
 {
    pkgDepCache::ActionGroup group(Cache);