dnf
dnf copied to clipboard
[repoquery] Do --latest-limit filter sooner (RhBug:1561795)
Move --latest-limit filter execution closer to --avaliable, --installed, --recent etc. This gives dnf repoquery ability to operate only on the newest available versions of packages when for example searching packages that require some capability.
Before the patch "dnf repoquery --latest-limit=1 --whatrequires CAPABILITY" command first limited the packageset to those providing the capability and then print only the newest versions of found packages. Now first the packageset is limited to the latest versions and than the capability is looked for.
https://bugzilla.redhat.com/show_bug.cgi?id=1561795
I believe that there will be a side effect with options --duplicates and --latest-limit=1 Before patch it returns the latest duplicate package, but after patch it returns empty set.
I'm not sure that using --latest-limit with --duplicates does make sense. --duplicates is supposed to return packages installed in multiple versions, --latest-limit limits the number of versions taken into account (and with latest-limit=1 there naturally can't be any duplicities)
Do we have any use case which requires using these two options together? In that case we need a test for it.
@rh-atomic-bot try
:hourglass: Trying commit 23b3d48 with merge d4f41a8...
Blocked to prevent accidental merge. I will do more investigation whether this change of repoquery behaviour does not affect other use cases.
I investigated the whole history of repoquery command and latest-limit filter was executed after --whatXXX from the very beginning. It was never moved because of some user request or bugfix.
Here are the situations where this patch changes previous behaviour and newly the repoquery would not return any results: $ dnf repoquery --duplicates --latest-limit=1 $ dnf repoquery --whatrequires libdnf-0:0.28.1-1.fc30.x86_64 --latest-limit=1 (basically all --whatXXX queries, given that there is newer version of libdnf available) $ dnf repoquery --file /usr/lib64/libdnf.so.2 (given that there is newer libdnf version available, which does not provide the file)
:sunny: Test successful - status-papr State: approved= try=True