From 8f8d3ee27eb3469ad6ff7d308dd637d1c37959aa Mon Sep 17 00:00:00 2001 From: Evan Goode Date: Mon, 17 Jul 2023 15:50:41 -0400 Subject: [PATCH] Allow obsoletion of protected packages As described at the end of this comment: https://github.com/rpm-software-management/dnf/pull/1926#issue-1692834834 There should be some mechanism for replacing even protected packages, e.g. to upgrade DNF to DNF 5. Obsoleting a protected package is less likely to happen accidentally than removing it. But this change does mean that a protected package could be obsoleted, and then the obsoleter could be removed, which is perhaps not ideal. IMO a better, more "declarative" way, might be to disallow any transaction that would result in a protected package no longer being provided. But I'm not sure how to do this without modifying libsolv. --- libdnf/goal/Goal.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/libdnf/goal/Goal.cpp b/libdnf/goal/Goal.cpp index 7def8371c..3684ce4bc 100644 --- a/libdnf/goal/Goal.cpp +++ b/libdnf/goal/Goal.cpp @@ -1631,8 +1631,6 @@ Goal::Impl::protectedInRemovals() if ((!protectedPkgs || !protectedPkgs->size()) && !protect_running_kernel) return false; auto pkgRemoveList = listResults(SOLVER_TRANSACTION_ERASE, 0); - auto pkgObsoleteList = listResults(SOLVER_TRANSACTION_OBSOLETED, 0); - map_or(pkgRemoveList.getMap(), pkgObsoleteList.getMap()); removalOfProtected.reset(new PackageSet(pkgRemoveList)); Id id = -1;