summaryrefslogtreecommitdiff
path: root/apt-pkg
diff options
context:
space:
mode:
authorJulian Andres Klode <julian.klode@canonical.com>2022-09-28 16:28:36 +0200
committerJulian Andres Klode <julian.klode@canonical.com>2022-09-28 16:32:44 +0200
commit5f5a8deedffac3cdeeb2f178d910d3759d366e8e (patch)
treeb50eb2c3ce3d058140d9fdf8206aed65da714378 /apt-pkg
parentf93a5aa2daa92255c75865b6f92dddb4b072ff33 (diff)
full-upgrade: Mark phased upgrades for keep before anything else
By marking them at the end, we might make other decisions that depend on the new phased updates, confusing the solver. Run the marking at the start too. The EDSP test file from Jeremy was modified to include Machine-ID and Phased-Update-Percentage fields and then filtered to mostly exclude packages irrelevant to the test case by running grep-dctrl \( -FRequest "EDSP 0.5" -o -FInstalled yes \ -oFPhased-Update-Percentage 10 \) \ -a --not -FArchitecture i386 LP: #1990586
Diffstat (limited to 'apt-pkg')
-rw-r--r--apt-pkg/upgrade.cc3
1 files changed, 3 insertions, 0 deletions
diff --git a/apt-pkg/upgrade.cc b/apt-pkg/upgrade.cc
index a7e18026b..e3e98e5c6 100644
--- a/apt-pkg/upgrade.cc
+++ b/apt-pkg/upgrade.cc
@@ -107,6 +107,7 @@ struct PhasedUpgrader
continue;
Cache.MarkKeep(I, false, false);
+ Cache.MarkProtected(I);
if (Fix != nullptr)
Fix->Protect(I);
}
@@ -133,6 +134,8 @@ static bool pkgDistUpgrade(pkgDepCache &Cache, OpProgress * const Progress)
pkgDepCache::ActionGroup group(Cache);
+ PhasedUpgrader().HoldBackIgnoredPhasedUpdates(Cache, nullptr);
+
/* Upgrade all installed packages first without autoinst to help the resolver
in versioned or-groups to upgrade the old solver instead of installing
a new one (if the old solver is not the first one [anymore]) */