Bug 2174337

Summary: dnf5 repoquery prints some packages twice
Product: [Fedora] Fedora Reporter: Martin Banas <mbanas>
Component: dnf5Assignee: amatej
Status: CLOSED CURRENTRELEASE QA Contact:
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 38CC: agurenko, amatej, jkolarik, nsella, pkratoch, rpm-software-management
Target Milestone: ---Keywords: Triaged
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2023-05-03 12:29:33 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
diff-y.log none

Description Martin Banas 2023-03-01 08:07:38 UTC
Created attachment 1947138 [details]
diff-y.log

Description of problem:
dnf5 repoquery prints some of the packages twice.

Version-Release number of selected component (if applicable):
[root@localhost ~]# dnf5 --version
dnf5 version 5.0.6
dnf5 plugin API version 1.0
libdnf5 version 5.0.6
libdnf5 plugin API version 1.0

How reproducible:
always

Steps to Reproduce:
a. compare dnf5 repoquery output to dnf repoquery output or
b. compare dnf5 repoquery | sort | wc -l with dnf5 repoquery | sort -u | wc -l

Actual results:
[root@localhost ~]# dnf5 repoquery | sort -u | wc -l
61526
[root@localhost ~]# dnf5 repoquery | sort | wc -l
61633

Expected results:
Same number of packages, as with dnf4:
[root@localhost ~]# dnf repoquery | sort -u | wc -l
Last metadata expiration check: 0:20:32 ago on Wed 01 Mar 2023 08:44:57 AM CET.
61524
[root@localhost ~]# dnf repoquery | sort | wc -l
Last metadata expiration check: 0:20:44 ago on Wed 01 Mar 2023 08:44:57 AM CET.
61524

Additional info:
Attached is the diff -y <(dnf repoquery | sort) <(dnf5 repoquery | sort) | grep -B2 -A2 '[<>]' output

Comment 1 amatej 2023-03-07 06:24:45 UTC
Thanks for the report.
This is because dnf5 doesn't de-duplicate the output yet.
Some packages can be present multiple times with the same nevra (for example in multiple repos).

I plan to resolve this in PR: https://github.com/rpm-software-management/dnf5/pull/318 but it is not yet implemented.