Extend Options with allow_erasing and allow_downgrade#4938
Extend Options with allow_erasing and allow_downgrade#4938vaibhavdaren wants to merge 3 commits into
Conversation
|
The PR description is too literal and unusable as a commit description. Keep it simple to only the reason of the implementation, not the literal implementation |
724f3f4 to
7b5d803
Compare
|
I would need the test cases to figure out if we are blocked by this. I don't suspect
|
|
Here is the breakdown for both flags and the specific package interactions that require them (these correspond to tests T8 and T9 in our validation matrix: 1. Why we need
|
| allow_untrusted: bool = False | ||
|
|
||
| #: If set, allow erasing conflicting or obsoleting packages (``--allowerasing``). | ||
| #: Supported by DNF4 and DNF5. |
There was a problem hiding this comment.
When support for this flag gets added to the emerge package manager, no-one will recall there's a list of package managers supporting it at this place. Good note, but better suited for the dnf package manager plugin.
There was a problem hiding this comment.
Moved the documentation to dnf in 4458573.
Add two new fields to the package manager Options container: - allow_erasing: emits --allowerasing via DnfEngine._extra_dnf_options, supported by both DNF4 and DNF5. Allows the resolver to erase packages that conflict with or are obsoleted by a requested install. - allow_downgrade: emits --allow-downgrade via a Dnf5Engine override only. DNF4 handles transitive dependency downgrades automatically; passing this flag to DNF4 would cause a fatal error on RHEL guests. No callers of the new fields are introduced in this commit.
06a8f60 to
4458573
Compare
Some artifact testing scenarios require the package manager to take actions it
would otherwise refuse by default:
under test, DNF blocks the install.
allow_erasing(--allowerasing) permitsDNF to remove the conflicting system package so the target artifact can be installed.
when the requested artifact requires an older version.
allow_downgrade(
--allow-downgrade) unlocks this for DNF5 (DNF4 already permits it by default).Both options extend the existing
Optionsdataclass and are wired into the DNFengine family.
YumEngineraises aPrepareErrorwhenallow_erasingis requestedsince
yumhas no equivalent flag.