X-Git-Url: https://git.saurik.com/apt.git/blobdiff_plain/6d38011bb93451dd9da3294614d821c77ac91687..76d4aab06d3c5edd60362fd14b38eb43416616f0:/apt-pkg/algorithms.cc diff --git a/apt-pkg/algorithms.cc b/apt-pkg/algorithms.cc index 2ca3404a0..fea9e92e1 100644 --- a/apt-pkg/algorithms.cc +++ b/apt-pkg/algorithms.cc @@ -20,7 +20,7 @@ #include #include #include -#include +#include #include #include @@ -740,14 +740,24 @@ 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); + int solver_in, solver_out; + if (EDSP::ExecuteSolver(solver.c_str(), &solver_in, &solver_out) == false) + return false; + + FILE* output = fdopen(solver_in, "w"); + if (output == NULL) + return _error->Errno("Resolve", "fdopen on solver stdin failed"); + EDSP::WriteRequest(Cache, output); + EDSP::WriteScenario(Cache, output); fclose(output); + + if (EDSP::ReadResponse(solver_out, Cache) == false) + return _error->Error("Reading solver response failed"); + + return true; } return ResolveInternal(BrokenFix); }