From 9f3ecca2b32e4fe56a05811392e01416092f85fa Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Tue, 17 Feb 2026 10:28:17 +0100 Subject: solver3: Upgrade by source package Implement the "APT::Get::Upgrade-By-Source-Package" option as the classic solver does. Here this is equally straight forward now: We enqueue optional, but eager, clauses of the form foo=2 -> foo-data=2 for each sibling in the source version, assuming they are currently installed, and the selection is not the current version. This softly enforces upgrades of already installed siblings, but in non-strict-pinning mode it will not affect the selection of new packages to be installed. A more complete solution to version selection by source package also seems feasible, where we change the "priority" of versions in the solver dynamically - currently they are statically evaluated. Such that, when you select foo=2, and something installs foo-data, foo-data would be installed in version 2 even if version 3 were its candidate. --- apt-pkg/solver3.h | 1 + 1 file changed, 1 insertion(+) (limited to 'apt-pkg/solver3.h') diff --git a/apt-pkg/solver3.h b/apt-pkg/solver3.h index 380aa3ad6..9af580b86 100644 --- a/apt-pkg/solver3.h +++ b/apt-pkg/solver3.h @@ -445,6 +445,7 @@ class DependencySolver final : public Solver bool DeferVersionSelection{_config->FindB("APT::Solver::Defer-Version-Selection", true)}; bool KeepRecommends{_config->FindB("APT::AutoRemove::RecommendsImportant", true)}; bool KeepSuggests{_config->FindB("APT::AutoRemove::SuggestsImportant", true)}; + bool UpgradeBySourcePackage{_config->FindB("APT::Get::Upgrade-By-Source-Package", true)}; // Helper functions for detecting obsolete packages mutable FastContiguousCacheMap pkgObsolete; -- cgit v1.2.3-70-g09d2