summaryrefslogtreecommitdiff
path: root/apt-pkg/algorithms.cc
diff options
context:
space:
mode:
authorJulian Andres Klode <jak@debian.org>2024-02-13 15:30:21 +0000
committerJulian Andres Klode <jak@debian.org>2024-02-13 15:30:21 +0000
commit3749cda6af91e495650018bae39185c2589c9bd7 (patch)
treefe7dfd0ab95faafa015de14cd7e3de948e53f853 /apt-pkg/algorithms.cc
parent26e0e9b76fb06afe5250eeb8e5b3d069d4793432 (diff)
parent1a0882558da05eaf471c2b4049ae27305e7c70ec (diff)
Merge branch 'phasing-api' into 'main'
Add public phased update API and separate message list See merge request apt-team/apt!327
Diffstat (limited to 'apt-pkg/algorithms.cc')
-rw-r--r--apt-pkg/algorithms.cc20
1 files changed, 20 insertions, 0 deletions
diff --git a/apt-pkg/algorithms.cc b/apt-pkg/algorithms.cc
index 3d4096a94..d841d6dd8 100644
--- a/apt-pkg/algorithms.cc
+++ b/apt-pkg/algorithms.cc
@@ -1246,6 +1246,26 @@ bool pkgProblemResolver::InstOrNewPolicyBroken(pkgCache::PkgIterator I)
return false;
}
/*}}}*/
+// ProblemResolver::KeepPhasedUpdates - Keep back phased updates /*{{{*/
+// ---------------------------------------------------------------------
+// Hold back upgrades to phased versions of already installed packages, unless
+// they are security updates
+bool pkgProblemResolver::KeepPhasedUpdates()
+{
+ for (pkgCache::PkgIterator I = Cache.PkgBegin(); I.end() == false; ++I)
+ {
+ if (not Cache.PhasingApplied(I))
+ continue;
+
+ Cache.MarkKeep(I, false, false);
+ Cache.MarkProtected(I);
+ Protect(I);
+ }
+
+ return true;
+}
+
+ /*}}}*/
// ProblemResolver::ResolveByKeep - Resolve problems using keep /*{{{*/
// ---------------------------------------------------------------------
/* This is the work horse of the soft upgrade routine. It is very gentle