From 89dd48bdea93849246fc33b447d6d7ad52bb1c4b Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Mon, 3 Jul 2023 11:13:00 +0200 Subject: dist-upgrade: Revert phased updates using keeps only In the bug, mutter was kept back due to phasing and the new gnome-shell depended on that, and was therefore kept back as well, however, gnome-shell-common was not broken, and apt decided to continue upgrading it by removing gnome-shell and the ubuntu desktop meta packages. This is potentially a regression of LP#1990586 where we added keep back calls to the start of the dist-upgrade to ensure that we do not mark stuff for upgrade in the first place that depends on phasing updates, however it was generally allowed by the resolver to also do those removals. To fix this, we need to resolve the update normally and then use ResolveByKeepInternal to keep back any changes broken by held back packages. However, doing so breaks test-bug-591882-conkeror because ResolveByKeep keeps back packages for broken Recommends as well, which is not something we generally want to do in a dist-upgrade after we already decided to upgrade it. To circumvent that issue, extend the pkgProblemResolver to allow a package to be policy broken, and mark all packages that already were already going to be policy broken to be allowed to be that, such that we don't try to undo their installs. LP: #2025462 --- apt-pkg/algorithms.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'apt-pkg/algorithms.cc') diff --git a/apt-pkg/algorithms.cc b/apt-pkg/algorithms.cc index 272917b08..3d4096a94 100644 --- a/apt-pkg/algorithms.cc +++ b/apt-pkg/algorithms.cc @@ -1234,7 +1234,8 @@ bool pkgProblemResolver::InstOrNewPolicyBroken(pkgCache::PkgIterator I) } // a newly broken policy (recommends/suggests) is a problem - if (Cache[I].NowPolicyBroken() == false && + if ((Flags[I->ID] & BrokenPolicyAllowed) == 0 && + Cache[I].NowPolicyBroken() == false && Cache[I].InstPolicyBroken() == true) { if (Debug == true) -- cgit v1.2.3-70-g09d2