Bug 1265025

Summary: "dnf repoquery" thinks that --repo is the --repofrompath option
Product: [Fedora] Fedora Reporter: Corey Ashford <cjashfor>
Component: dnf-plugins-coreAssignee: Packaging Maintenance Team <packaging-team-maint>
Status: CLOSED DUPLICATE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 22CC: jsilhan, mluscon, packaging-team-maint, pnemade, rholy, tim.lauridsen, vmukhame
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-09-22 07:01:49 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 Corey Ashford 2015-09-21 23:29:49 UTC
Description of problem:


Version-Release number of selected component (if applicable):
dnf-plugins-core-0.1.11-1.fc22.noarch


How reproducible:
100%

Steps to Reproduce:
1.Run this command:
dnf repoquery --repofrompath foo,ftp://mirror.web-ster.com/fedora/releases/22/Everything/x86_64/os/ --repo foo

2. Observe the usage error in the output


Actual results:

usage: dnf [--allowerasing] [-b] [-C] [-c [config file]] [-d [debug level]] [--debugsolver] [--showduplicates]
           [-e ERRORLEVEL] [--rpmverbosity [debug level name]] [-q] [-v] [-y] [--assumeno] [--version]
           [--installroot [path]] [--enablerepo [repo]] [--disablerepo [repo]] [-x [package]]
           [--disableexcludes [repo]] [--repofrompath [repo,path]] [--noplugins] [--nogpgcheck]
           [--disableplugin [plugin]] [--color COLOR] [--releasever RELEASEVER] [--setopt SETOPTS] [--refresh] [-4]
           [-6] [-h]
Command line error: argument --repofrompath: bad format: foo


Expected results:
A listing of all of the packages in the "foo" repository, and only in the "foo" repository


Additional info:
If I eliminate the --repo option, I no longer get an error about the --repofrompath option, but I get results from the default repos in addition to my "foo" repo.

My current work-around is to use the deprecated repoquery command.

Comment 1 Radek Holy 2015-09-22 07:01:49 UTC
Actually, it says "bad format: foo". In fact, DNF thinks that by "--repo" you mean "--repofrompath" again and it expects the correct format. This is a feature of the Python's argument parser [1]. This in combination with our problematic design of argument parsing process causes this error. We are working on it.

[1] https://docs.python.org/dev/library/argparse.html?highlight=argparse#prefix-matching

*** This bug has been marked as a duplicate of bug 1260986 ***