dnf icon indicating copy to clipboard operation
dnf copied to clipboard

[repoquery] Do --latest-limit filter sooner (RhBug:1561795)

Open m-blaha opened this issue 5 years ago • 8 comments

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

m-blaha avatar Aug 29 '19 06:08 m-blaha

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.

j-mracek avatar Aug 29 '19 10:08 j-mracek

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)

m-blaha avatar Aug 29 '19 11:08 m-blaha

Do we have any use case which requires using these two options together? In that case we need a test for it.

m-blaha avatar Aug 29 '19 11:08 m-blaha

@rh-atomic-bot try

j-mracek avatar Aug 29 '19 12:08 j-mracek

:hourglass: Trying commit 23b3d48 with merge d4f41a8...

rh-atomic-bot avatar Aug 29 '19 12:08 rh-atomic-bot

Blocked to prevent accidental merge. I will do more investigation whether this change of repoquery behaviour does not affect other use cases.

m-blaha avatar Aug 29 '19 12:08 m-blaha

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)

m-blaha avatar Aug 29 '19 13:08 m-blaha

:sunny: Test successful - status-papr State: approved= try=True

rh-atomic-bot avatar Aug 29 '19 15:08 rh-atomic-bot