Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow obsoletion of protected packages #733

Conversation

evan-goode
Copy link
Member

@Conan-Kudo
Copy link
Member

Could you please put the details in the commit message instead of referring to another PR?

@evan-goode evan-goode self-assigned this Jul 20, 2023
@evan-goode evan-goode force-pushed the evan-goode/allow-obsolete-protected branch from ddd2b54 to e4c3f3d Compare July 20, 2023 13:30
@evan-goode
Copy link
Member Author

Could you please put the details in the commit message instead of referring to another PR?

Thanks, I added some details to the commit message.

@j-mracek
Copy link
Contributor

This change might be problematic, because you can remove protected package in two steps protected -> obsoleted -> removed. But I agree to try it. It might be interesting to search in dnf/yum commit history when and why dnf/yum started with protection from obsoleting packages.

@m-blaha
Copy link
Member

m-blaha commented Jul 21, 2023

I didn't find any particular reason - the obsoleted packages are just there from the beginning.

Here is the forefather of the current implementation - rpm-software-management/yum@ab34fab .

And here is how the protected packages yum plugin looked like when it was moved from plugins to core: rpm-software-management/yum-utils@610ef70

@evan-goode
Copy link
Member Author

Ah, this change would unfortunately break the way we protect the running kernel from being removed. The failing test is:

  @bz1698145
  Scenario: Running kernel is protected against obsoleting                                     # dnf/protect-running-kernel.feature:44

I think it would be best to find another way to allow upgrading DNF 4 to DNF 5 while keeping DNF 4 "protected".

@evan-goode
Copy link
Member Author

Per @j-mracek's recommendation, I am reopening this and treating the running kernel as a special case.

So now with this patch, obsoleting protected packages is allowed, except for the running kernel, which cannot be removed or obsoleted.

I think this approach is reasonable; there should be some way for the distribution to "unprotect" packages.

One use case that might be broken by this change is a user protecting a package to prevent it from being obsoleted by something else in the distribution. But that's a problem better suited for excludepkgs.

@j-mracek j-mracek assigned j-mracek and unassigned evan-goode Sep 11, 2023
This is the libdnf5 companion to
rpm-software-management/libdnf#1610; if we
change DNF 4, then we should also change DNF 5.

There should be some mechanism for replacing even protected packages,
e.g. to upgrade DNF to DNF 5. We unprotected dnf to allow this upgrade,
but that solution isn't perfect; DNF 5 should be able to remove
python3-dnf[1] and DNF 4 should not be able to remove DNF without
installing DNF 5. @m-blaha proposed "implementing a hard-coded
self-protection for each package manager", i.e. adding back the
hardcoded protection of dnf and python3-dnf in DNF 4 and adding a
protection of dnf5 in DNF 5. So if we want to do this, it seems we would
need to allow obsoletion of protected packages to allow DNF 4 to
obsolete dnf with dnf5.

The running kernel is treated as a special case; obsoletes of the
running kernel are still not allowed.
@evan-goode evan-goode force-pushed the evan-goode/allow-obsolete-protected branch from 71e82c4 to 799cc1c Compare September 12, 2023 18:14
@j-mracek j-mracek added this pull request to the merge queue Sep 13, 2023
Merged via the queue into rpm-software-management:main with commit a3464eb Sep 13, 2023
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

4 participants