summaryrefslogtreecommitdiff
path: root/apt-pkg/solver3.h
diff options
context:
space:
mode:
authorJulian Andres Klode <jak@debian.org>2025-03-09 14:25:51 +0000
committerJulian Andres Klode <jak@debian.org>2025-03-09 14:25:51 +0000
commitef5abb4e0702372e945c516a31befff03f641a5d (patch)
tree1032f7f4727c45306c1de38faa24c9e5bbc34c9e /apt-pkg/solver3.h
parent153bbf448f91eb347574624890c36f97cd168b53 (diff)
parent5daf6dbfd272be2f8e3c59d4bab4be8c119b7aa1 (diff)
Merge branch 'solver3' into 'main'
solver3: Do not prefer new installs over manually installed obsoletes See merge request apt-team/apt!458
Diffstat (limited to 'apt-pkg/solver3.h')
-rw-r--r--apt-pkg/solver3.h13
1 files changed, 8 insertions, 5 deletions
diff --git a/apt-pkg/solver3.h b/apt-pkg/solver3.h
index 9d4a195ec..b7000c52e 100644
--- a/apt-pkg/solver3.h
+++ b/apt-pkg/solver3.h
@@ -146,21 +146,21 @@ class Solver
ContiguousCacheMap<pkgCache::Version, State> verStates;
// \brief Helper function for safe access to package state.
- inline State &operator[](pkgCache::Package *P)
+ inline State &operator[](const pkgCache::Package *P)
{
return pkgStates[P];
}
- inline const State &operator[](pkgCache::Package *P) const
+ inline const State &operator[](const pkgCache::Package *P) const
{
return pkgStates[P];
}
// \brief Helper function for safe access to version state.
- inline State &operator[](pkgCache::Version *V)
+ inline State &operator[](const pkgCache::Version *V)
{
return verStates[V];
}
- inline const State &operator[](pkgCache::Version *V) const
+ inline const State &operator[](const pkgCache::Version *V) const
{
return verStates[V];
}
@@ -169,7 +169,9 @@ class Solver
inline const State &operator[](Var r) const;
mutable FastContiguousCacheMap<pkgCache::Package, char> pkgObsolete;
- bool Obsolete(pkgCache::PkgIterator pkg) const;
+ // \brief Check if package is obsolete.
+ // \param AllowManual controls whether manual packages can be obsolete
+ bool Obsolete(pkgCache::PkgIterator pkg, bool AllowManual=false) const;
bool ObsoletedByNewerSourceVersion(pkgCache::VerIterator cand) const;
mutable FastContiguousCacheMap<pkgCache::Version, short> priorities;
@@ -471,6 +473,7 @@ struct APT::Solver::State
struct
{
bool discovered{};
+ bool manual{};
} flags;
static_assert(sizeof(flags) <= sizeof(int));