Note: This is a public test instance of Red Hat Bugzilla. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback at bugzilla.redhat.com.

Bug 1790262

Summary: dnf repoquery --whatprovides does not support multi paremeters
Product: [Fedora] Fedora Reporter: Shuicheng Lin <shuicheng.lin>
Component: dnfAssignee: Marek Blaha <mblaha>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 32CC: jmracek, jrohel, mblaha, mhatina, ngompa13, packaging-team-maint, pkratoch, praiskup, rpm-software-management, vmukhame
Target Milestone: ---Keywords: Triaged
Target Release: ---   
Hardware: Unspecified   
OS: All   
Whiteboard:
Fixed In Version: dnf-4.2.21-1.fc32 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-05-01 04:04:41 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:

Description Shuicheng Lin 2020-01-13 01:17:08 UTC
Description of problem:
when using repoquery in yum, when run below command “sudo  repoquery -c $MY_WORKSPACE/export/yum.conf --whatprovides 'bash' 'yum'”

it will show the below result. 

bash-0:4.2.46-31.el7.x86_64
bash-0:4.2.46-31.el7.tis.4.x86_64
yum-0:3.4.3-161.el7.centos.noarch

But for repoquery of dnf, 

[sysadmin@centos8-dev ~] $  dnf --cacheonly -c /etc/yum.conf repoquery --whatprovides  'dnf'
dnf-0:4.0.9.2-1.el7_6.noarch
dnf-0:4.0.9.2-5.el8.noarch
[sysadmin@centos8-dev ~] $  dnf --cacheonly -c /etc/yum.conf repoquery --whatprovides  'bash'
bash-0:4.2.46-33.el7.x86_64
bash-0:4.4.19-7.el8.i686
bash-0:4.4.19-7.el8.x86_64
bash-0:4.4.19-8.el8_0.x86_64

But for 
"dnf --cacheonly -c /etc/yum.conf repoquery --whatprovides  'dnf' 'bash'"
it return empty result. 

or
"dnf --cacheonly -c /etc/yum.conf repoquery --whatprovides  'dnf' --whatprovides 'bash'"

it only return 'bash' result , no dnf result. 

bash-0:4.2.46-33.el7.x86_64
bash-0:4.4.19-7.el8.i686
bash-0:4.4.19-7.el8.x86_64
bash-0:4.4.19-8.el8_0.x86_64



Version-Release number of selected component (if applicable):
[sysadmin@centos8-dev ~] $ dnf --version
4.0.9
  Installed: dnf-0:4.0.9.2-5.el8.noarch at Mon 30 Dec 2019 03:11:24 PM GMT
  Built    : CentOS Buildsys <bugs> at Mon 13 May 2019 07:35:13 PM GMT

  Installed: rpm-0:4.14.2-11.el8_0.x86_64 at Tue 31 Dec 2019 07:49:42 AM GMT
  Built    : CentOS Buildsys <bugs> at Tue 01 Oct 2019 01:45:29 PM GMT


How reproducible:

As mentioned up. 
Steps to Reproduce:
1.
2.
3.

Actual results:


Expected results:


Additional info:

Comment 1 Marek Blaha 2020-01-13 11:31:10 UTC
This is regression, my guess is that it is somehow connected with change of the option parser. I'll look into it.

Comment 2 Marek Blaha 2020-01-13 12:00:56 UTC
Sorry my fault, it is not a regression. The correct way how to add more arguments to --what* switches is to separate them by comma:

$ dnf repoquery --whatprovides dnf,bash
bash-0:5.0.11-1.fc30.i686
bash-0:5.0.11-1.fc30.x86_64
bash-0:5.0.2-1.fc30.i686
bash-0:5.0.2-1.fc30.x86_64
dnf-0:4.2.17-1.fc30.noarch
dnf-0:4.2.17-24g60b69848.fc30.noarch
dnf-0:4.2.17-28gc9b9087c.fc30.noarch
dnf-0:4.2.17-31g9fcfb492.fc30.noarch
dnf-0:4.2.17-35g7a43cebe.fc30.noarch
dnf-0:4.2.2-2.fc30.noarch

But unfortunately it is not documented.

Comment 3 Marek Blaha 2020-02-04 12:42:45 UTC
Here is PR with documentation enhancements for --what* switches: https://github.com/rpm-software-management/dnf/pull/1583

Comment 4 Ben Cotton 2020-02-11 17:20:04 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 32 development cycle.
Changing version to 32.

Comment 5 Fedora Update System 2020-04-09 10:56:48 UTC
FEDORA-2020-68aa5586ed has been submitted as an update to Fedora 32. https://bodhi.fedoraproject.org/updates/FEDORA-2020-68aa5586ed

Comment 6 Fedora Update System 2020-04-09 18:40:16 UTC
FEDORA-2020-68aa5586ed has been pushed to the Fedora 32 testing repository.
In short time you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --advisory=FEDORA-2020-68aa5586ed`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2020-68aa5586ed

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 7 Fedora Update System 2020-05-01 04:04:41 UTC
FEDORA-2020-68aa5586ed has been pushed to the Fedora 32 stable repository.
If problem still persists, please make note of it in this bug report.