summaryrefslogtreecommitdiff
path: root/apt-pkg/edsp.cc
diff options
context:
space:
mode:
authorJulian Andres Klode <jak@debian.org>2024-05-14 10:26:45 +0000
committerJulian Andres Klode <jak@debian.org>2024-05-14 10:26:45 +0000
commit422fb4f9637d0164dec9e55dc3df56c89af65a64 (patch)
tree3fef52a852123c958314cd2d2a4ec319a58b1523 /apt-pkg/edsp.cc
parent6d96601ede7164620cc404ef8ead7d72c3010b8d (diff)
parentd2323b179c4fafa0424177a8c702166722384b14 (diff)
Merge branch 'solver3' into 'main'
Initial implementation of the 3.0 solver See merge request apt-team/apt!347
Diffstat (limited to 'apt-pkg/edsp.cc')
-rw-r--r--apt-pkg/edsp.cc13
1 files changed, 13 insertions, 0 deletions
diff --git a/apt-pkg/edsp.cc b/apt-pkg/edsp.cc
index a02e400c2..589400870 100644
--- a/apt-pkg/edsp.cc
+++ b/apt-pkg/edsp.cc
@@ -19,6 +19,7 @@
#include <apt-pkg/pkgsystem.h>
#include <apt-pkg/prettyprinters.h>
#include <apt-pkg/progress.h>
+#include <apt-pkg/solver3.h>
#include <apt-pkg/string_view.h>
#include <apt-pkg/strutl.h>
#include <apt-pkg/tagfile.h>
@@ -765,6 +766,18 @@ static bool CreateDumpFile(char const * const id, char const * const type, FileF
// EDSP::ResolveExternal - resolve problems by asking external for help {{{*/
bool EDSP::ResolveExternal(const char* const solver, pkgDepCache &Cache,
unsigned int const flags, OpProgress *Progress) {
+ if (strcmp(solver, "3.0") == 0)
+ {
+ APT::Solver s(Cache.GetCache(), Cache.GetPolicy());
+ FileFd output;
+ if (not s.FromDepCache(Cache))
+ return false;
+ if (not s.Solve())
+ return false;
+ if (not s.ToDepCache(Cache))
+ return false;
+ return true;
+ }
if (strcmp(solver, "internal") == 0)
{
FileFd output;