Bug 1612469 - --latest-limit=x switch behaves differently for rawhide and for f28
Summary: --latest-limit=x switch behaves differently for rawhide and for f28
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Fedora
Classification: Fedora
Component: dnf
Version: 29
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Jaroslav Mracek
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-08-04 22:26 UTC by clime
Modified: 2019-07-29 10:53 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2019-07-29 10:53:59 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description clime 2018-08-04 22:26:31 UTC
Description of problem:

In f28 (dnf-2.7.5), I am getting:

$ dnf repoquery --repofrompath=prunerepo_query,/home/clime/copr/prunerepo/tests/2srpmsfor1rpm/repo-test --repo=prunerepo_query --refresh --queryformat="%{location}" --quiet --latest-limit=2
00000007-motionpaint-1.4/python-motionpaint-1.4-1.fc23.src.rpm
00000007-motionpaint-1.4/python3-motionpaint-1.4-1.fc23.noarch.rpm
00000009-motionpaint-1.4/python-motionpaint-1.4-1.fc23.src.rpm
00000009-motionpaint-1.4/python3-motionpaint-1.4-1.fc23.noarch.rpm

In rawhide (dnf-3.0.2):

# dnf repoquery --repofrompath=prunerepo_query,/copr/prunerepo/tests/2srpmsfor1rpm/repo-test --repo=prunerepo_query --refresh --queryformat="%{location}" --quiet --latest-limit=2
00000003-motionpaint-1.3/python-motionpaint-1.3-1.fc23.src.rpm
00000003-motionpaint-1.3/python3-motionpaint-1.3-1.fc23.noarch.rpm
00000005-motionpaint-1.3/python-motionpaint-1.3-1.fc23.src.rpm
00000005-motionpaint-1.3/python3-motionpaint-1.3-1.fc23.noarch.rpm
00000007-motionpaint-1.4/python-motionpaint-1.4-1.fc23.src.rpm
00000007-motionpaint-1.4/python3-motionpaint-1.4-1.fc23.noarch.rpm
00000009-motionpaint-1.4/python-motionpaint-1.4-1.fc23.src.rpm
00000009-motionpaint-1.4/python3-motionpaint-1.4-1.fc23.noarch.rpm

The queries are the same (except the difference in the input path and user under which it is run) and the data on which it is run are the same.

Yet, the results are different. In the first case, two packages (together with srpms) are output, in the second case 4 packages (together with the srpms) are output.

You can find the data that have been used for the query here:

https://pagure.io/copr/copr/blob/master/f/prunerepo/tests/2srpmsfor1rpm/repo-template

Version-Release number of selected component (if applicable):

dnf-3.0.2

How reproducible:
Always


Actual results:
4 packages are returned


Expected results:
2 packages are returned


Additional info:
This makes tests for the prunerepo package fail. I haven't found any info about this change in the rpm changelog. I suspect that previously if there were multiple packages with the same nevra in a repository, a criterion based on `<time file="1456171751" build="1455930120"/>` data from primary file was used to determine what package to return. Can we maintain this behavior?

Comment 2 Jan Kurik 2018-08-14 08:39:07 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 29 development cycle.
Changing version to '29'.

Comment 3 Jaroslav Mracek 2019-07-29 10:53:59 UTC
The latest filter changed behaviour. Now it always return number of versions specified for each architecture and not number of packages. When multiple packages with same version in repositories, all of them are returned.

In your repository you have two builds for same package, therefore it shows two packages for each version.

I am sorry but the change of behaviour was intended.


Note You need to log in before you can comment on or make changes to this bug.