diff options
| author | Julian Andres Klode <julian.klode@canonical.com> | 2022-06-24 16:09:24 +0200 |
|---|---|---|
| committer | Julian Andres Klode <julian.klode@canonical.com> | 2022-06-28 14:25:18 +0200 |
| commit | db131677bee45c86031d37d7b451e6ece692efb2 (patch) | |
| tree | 851d7bd7d9accde19354acb847b255689606f21a /apt-pkg/policy.cc | |
| parent | 5a042d8c8e8265fc8b8a123b93cbebc9e345556b (diff) | |
(Temporarily) Rewrite phased updates using a keep-back approach
This is a lot closer to the original implementation in update-manager,
but still has a couple of differences that might cause bugs:
- When checking whether a version is a security update, we only
check versions in between and not any later version. This happens
mostly because we do not know the suite, so we just check if there
is any version between the installed version and our target that
is a security update
- We only keep already installed packages, as we run before the
resolver. update-manager first runs the resolver, and then marks
for keep all packages that were upgraded or newly installed that
are phasing (afaict).
This approach has a significant caveat that if you have version 1
installed from a release pocket, version 2 is in security, and version
3 is phasing in updates, that it installs version 3 rather than 2
from security as the policy based implementation does.
It also means that apt install does not respect phasing and would
always install version 3 in such a scenario.
LP: #1979244
Diffstat (limited to 'apt-pkg/policy.cc')
| -rw-r--r-- | apt-pkg/policy.cc | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/apt-pkg/policy.cc b/apt-pkg/policy.cc index b30eddb37..fcb7299f4 100644 --- a/apt-pkg/policy.cc +++ b/apt-pkg/policy.cc @@ -288,6 +288,10 @@ void pkgPolicy::CreatePin(pkgVersionMatch::MatchType Type,string Name, // Returns true if this update is excluded by phasing. static inline bool ExcludePhased(std::string machineID, pkgCache::VerIterator const &Ver) { + // FIXME: We have migrated to a legacy implementation until LP: #1929082 is fixed + if (not _config->FindB("APT::Get::Phase-Policy", false)) + return false; + // The order and fallbacks for the always/never checks come from update-manager and exist // to preserve compatibility. if (_config->FindB("APT::Get::Always-Include-Phased-Updates", |
