Drop XML parsing, switch to using dnf excludepkgs (#5) #32

Merged
adamwill merged 1 commit from dnf-excludepkgs into main 2026-04-20 18:32:30 +00:00

1 commit

Author SHA1 Message Date
251fd11d3b Drop XML parsing, switch to using dnf excludepkgs (#5)
All checks were successful
CI via Tox / tox (pull_request) Successful in 1m28s
Instead of painfully retrieving, decompressing, parsing, editing
and reconstructing the repodata, let's use dnf's excludepkgs
option to achieve the same thing. This is much simpler, faster,
and more robust.

To 'modify' the modified base repos, we use dnf repoquery to
list the packages they contain and their source RPM names, then
construct a table with the NEVRs to be removed for each repo.
Then when we do the repoclosure command, we pass
--setopt <repo>.excludepkgs=<nevrlist> for each modified repo.
This tells dnf to act as if the specified NEVRs simply do not
exist in the specified repo, which is exactly what we want to
achieve.

Signed-off-by: Adam Williamson <awilliam@redhat.com>
2026-04-18 00:05:57 -07:00