X-Git-Url: https://git.saurik.com/apt.git/blobdiff_plain/e3674d91d27a7290d2b01e14eb2540e10be9d883..df783e0aa69f70b7be2b7fb44cc593efd86f7730:/apt-pkg/algorithms.cc diff --git a/apt-pkg/algorithms.cc b/apt-pkg/algorithms.cc index 35752a5c4..5d9fefaa6 100644 --- a/apt-pkg/algorithms.cc +++ b/apt-pkg/algorithms.cc @@ -20,7 +20,7 @@ #include #include #include -#include +#include #include #include @@ -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,20 +749,7 @@ 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; - } + return EDSP::ResolveExternal(solver.c_str(), Cache, false, false, false); return ResolveInternal(BrokenFix); } /*}}}*/ @@ -1226,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);