summaryrefslogtreecommitdiff
path: root/apt-pkg/solver3.h
diff options
context:
space:
mode:
authorJulian Andres Klode <jak@debian.org>2025-01-30 14:12:56 +0000
committerJulian Andres Klode <jak@debian.org>2025-01-30 14:12:56 +0000
commit6425f211c0c85863232afb2d8e7eff95d150bddd (patch)
treeafb2e8fe02a6321ac2569da89c0fd2ced8851c89 /apt-pkg/solver3.h
parent184ac78d3dd21b9d6c3b539703de803f0f7132a7 (diff)
parentafc0a37872b24a6e4cc31d0a7b04a16d7b8f149a (diff)
Merge branch 'solver3' into 'main'
solver3: Unit propagation queues See merge request apt-team/apt!440
Diffstat (limited to 'apt-pkg/solver3.h')
-rw-r--r--apt-pkg/solver3.h12
1 files changed, 8 insertions, 4 deletions
diff --git a/apt-pkg/solver3.h b/apt-pkg/solver3.h
index a643d5d07..4f6f83d15 100644
--- a/apt-pkg/solver3.h
+++ b/apt-pkg/solver3.h
@@ -46,7 +46,6 @@ class Solver
enum class Group : uint8_t
{
HoldOrDelete,
- NewUnsatRecommends,
// Satisfying dependencies on entirely new packages first is a good idea because
// it may contain replacement packages like libfoo1t64 whereas we later will see
@@ -57,6 +56,9 @@ class Solver
// try it last.
SatisfyObsolete,
+ // Select a version of a package chosen for install.
+ SelectVersion,
+
// My intuition tells me that we should try to schedule upgrades first, then
// any non-obsolete installed packages, and only finally obsolete ones, such
// that newer packages guide resolution of dependencies for older ones, they
@@ -130,6 +132,9 @@ class Solver
// queue to be concerned about
std::vector<Solved> solved{};
+ // \brief Propagation queue
+ std::queue<Var> propQ;
+
// \brief Current decision level.
//
// This is an index into the solved vector.
@@ -153,6 +158,8 @@ class Solver
bool RejectReverseDependencies(pkgCache::VerIterator Ver);
// \brief Enqueue a single or group
bool EnqueueOrGroup(pkgCache::DepIterator start, pkgCache::DepIterator end, Var reason);
+ // \brief Propagate all pending propagations
+ bool Propagate();
// \brief Propagate a "true" value of a variable
bool PropagateInstall(Var var);
// \brief Propagate a rejection of a variable
@@ -184,9 +191,6 @@ class Solver
// Enqueue a decision fact
bool Enqueue(Var var, bool decision, Var reason);
- // \brief Mark the package for install. This is annoying as it incurs a decision
- bool Install(pkgCache::PkgIterator Pkg, Var reason, Group group);
-
// \brief Apply the selections from the dep cache to the solver
bool FromDepCache(pkgDepCache &depcache);
// \brief Apply the solver result to the depCache