Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor code in
repoinfo
to use opts.command correctly.
Commit de9643a (first shipped in dnf 4.2.8) changed opts.command from a list to a simple string, but code in RepoListCommand still handled it as if it was a list. It turns out this code didn't really break, since the Python `in` operator works on strings by checking the substring. So while this went from an exact match to a substring match, in this particular case the two will match the same cases. So `repoinfo` continued working as expected even after the list -> string change. Nevertheless, we should fix this code to now handle this properly as a string and use an exact comparison instead of the substring check. This commit also refactors some of the code, to use explicit `or` checks rather than an `any(...)` operator with a tuple, since there was no particular reason to use the `any(...)` form and the code didn't rely on not short-circuiting behavior of building the tuple (none of the conditions involved had side effects.) Tested that the `dnf repoinfo` command works the same before and after this change. Also tested that `dnf repoinfo --all` keeps showing all repositories with their enabled/disabled status correctly. Closes: #1611 Approved by: m-blaha
- Loading branch information