]> git.saurik.com Git - apt.git/blobdiff - apt-pkg/algorithms.cc
send the first line of the error message to the error list and fail a bit
[apt.git] / apt-pkg / algorithms.cc
index 35752a5c43f584ebf57b20bdc7b64cbb02870bf9..31c3e9c28633316d7835f7e4743229e4e99a0bf6 100644 (file)
@@ -20,7 +20,7 @@
 #include <apt-pkg/version.h>
 #include <apt-pkg/sptr.h>
 #include <apt-pkg/acquire-item.h>
-#include <apt-pkg/edspwriter.h>
+#include <apt-pkg/edsp.h>
 
 #include <apti18n.h>
 #include <sys/types.h>
@@ -332,6 +332,12 @@ bool pkgFixBroken(pkgDepCache &Cache)
  */
 bool pkgDistUpgrade(pkgDepCache &Cache)
 {
+   std::string const solver = _config->Find("APT::Solver::Name", "internal");
+   if (solver != "internal") {
+      OpTextProgress Prog(*_config);
+      return EDSP::ResolveExternal(solver.c_str(), Cache, false, true, false, &Prog);
+   }
+
    pkgDepCache::ActionGroup group(Cache);
 
    /* Upgrade all installed packages first without autoinst to help the resolver
@@ -384,6 +390,12 @@ 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") {
+      OpTextProgress Prog(*_config);
+      return EDSP::ResolveExternal(solver.c_str(), Cache, true, false, false, &Prog);
+   }
+
    pkgDepCache::ActionGroup group(Cache);
 
    pkgProblemResolver Fix(&Cache);
@@ -740,20 +752,9 @@ bool pkgProblemResolver::DoUpgrade(pkgCache::PkgIterator Pkg)
 bool pkgProblemResolver::Resolve(bool BrokenFix)
 {
    std::string const solver = _config->Find("APT::Solver::Name", "internal");
-   if (solver != "internal")
-   {
-      FILE* output = fopen("/tmp/universe.log", "w");
-      edspWriter::WriteUniverse(Cache, output);
-      fclose(output);
-      output = fopen("/tmp/request.log", "w");
-      edspWriter::WriteRequest(Cache, output);
-      fclose(output);
-      if (ResolveInternal(BrokenFix) == false)
-        return false;
-      output = fopen("/tmp/solution.log", "w");
-      edspWriter::WriteSolution(Cache, output);
-      fclose(output);
-      return true;
+   if (solver != "internal") {
+      OpTextProgress Prog(*_config);
+      return EDSP::ResolveExternal(solver.c_str(), Cache, false, false, false, &Prog);
    }
    return ResolveInternal(BrokenFix);
 }
@@ -1226,6 +1227,21 @@ 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") {
+      OpTextProgress Prog(*_config);
+      return EDSP::ResolveExternal(solver.c_str(), Cache, true, false, false, &Prog);
+   }
+   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);