Skip to content

Commit

Permalink
Allow obsoletion of protected packages
Browse files Browse the repository at this point in the history
As described at the end of this comment:
rpm-software-management/dnf#1926 (comment)

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.
  • Loading branch information
evan-goode committed Jul 17, 2023
1 parent 3fca06e commit 8f8d3ee
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions libdnf/goal/Goal.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 8f8d3ee

Please sign in to comment.