From 9d0f306b3e1b4a485b6fb31e90ae849d2a46c636 Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Sun, 25 May 2025 19:39:45 +0200 Subject: solver3: Allow CompareProviders3 with empty package This can be used to compare arbitrary packages in non-dependency contexts. It remains to be seen whether this is a meaningful approach. --- apt-pkg/solver3.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'apt-pkg') diff --git a/apt-pkg/solver3.cc b/apt-pkg/solver3.cc index 749633d52..489d4081b 100644 --- a/apt-pkg/solver3.cc +++ b/apt-pkg/solver3.cc @@ -135,7 +135,7 @@ struct APT::Solver::CompareProviders3 /*{{{*/ if ((A->CurrentVer == 0 || B->CurrentVer == 0) && A->CurrentVer != B->CurrentVer) return A->CurrentVer != 0; // Prefer packages in the same group as the target; e.g. foo:i386, foo:amd64 - if (A->Group != B->Group) + if (A->Group != B->Group && not Pkg.end()) { if (A->Group == Pkg->Group && B->Group != Pkg->Group) return true; -- cgit v1.2.3-70-g09d2