Bug 1446641 - dnf repoquery --duplicates --latest-limit -1 -q does not work
Summary: dnf repoquery --duplicates --latest-limit -1 -q does not work
Alias: None
Product: Fedora
Classification: Fedora
Component: dnf-plugins-core
Version: 26
Hardware: Unspecified
OS: Unspecified
Target Milestone: ---
Assignee: rpm-software-management
QA Contact: Fedora Extras Quality Assurance
Keywords: Triaged
: 1428015 1467293 (view as bug list)
Depends On:
TreeView+ depends on / blocked
Reported: 2017-04-28 13:31 UTC by Dennis Gilmore
Modified: 2017-08-04 11:38 UTC (History)
6 users (show)

Clone Of:
Last Closed: 2017-05-14 20:19:41 UTC

Attachments (Terms of Use)

External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Bugzilla 1467293 None None None Never

Internal Trackers: 1467293

Description Dennis Gilmore 2017-04-28 13:31:06 UTC
Description of problem:
after having some issues with an upgrade I have a bunch of dupes 

The process documented http://dnf.readthedocs.io/en/latest/command_ref.html#repoquery-command-label fails claiming that the dnf query is invalid

it seems it is the -1 if i change it to a 1 I get the latest builds not the older ones

[root@bbb02 ~]# dnf repoquery --duplicates --latest-limit -1 -q
usage: dnf repoquery [-c [config file]] [-q] [-v] [--version]
                     [--installroot [path]] [--nodocs] [--noplugins]
                     [--disableplugin [plugin]] [--releasever RELEASEVER]
                     [--setopt SETOPTS] [--skip-broken] [-h] [--allowerasing]
                     [-b] [-C] [-R [minutes]] [-d [debug level]]
                     [--debugsolver] [--showduplicates] [-e ERRORLEVEL]
                     [--obsoletes] [--rpmverbosity [debug level name]] [-y]
                     [--assumeno] [--enablerepo [repo]] [--disablerepo [repo]
                     | --repo [repo]] [-x [package]]
                     [--disableexcludes [repo]] [--repofrompath [repo,path]]
                     [--nogpgcheck] [--color COLOR] [--refresh] [-4] [-6]
                     [--downloadonly] [--bugfix] [--enhancement]
                     [--newpackage] [--security] [--advisory ADVISORY]
                     [--bzs BUGZILLA] [--cves CVES]
                     [--sec-severity {Critical,Important,Moderate,Low}] [-a]
                     [--show-duplicates] [--arch ARCH] [-f FILE [FILE ...]]
                     [--whatconflicts REQ] [--whatobsoletes REQ]
                     [--whatprovides REQ] [--whatrequires REQ]
                     [--whatrecommends REQ] [--whatenhances REQ]
                     [--whatsuggests REQ] [--whatsupplements REQ]
                     [--alldeps | --exactdeps] [--recursive] [--deplist]
                     [--querytags] [--resolve] [--tree] [--srpm]
                     [--latest-limit LATEST_LIMIT]
                     [-i | -l | -s | --qf QUERYFORMAT | --nevra | --nvr | --envra]
                     [--duplicates | --installonly | --unsatisfied]
                     [--conflicts | --enhances | --provides | --recommends | --requires | --requires-pre | --suggests | --supplements]
                     [--installed | --extras | --upgrades | --unneeded]
                     [key [key ...]]

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

How reproducible:

Steps to Reproduce:

Actual results:

Expected results:

Additional info:

Comment 1 Jaroslav Mracek 2017-05-03 14:36:29 UTC
The problem here is with argparser. Value -1 is recognized as a option not a value. There are some workaround:
1. --latest-limit=-1
2. --latest-limit " -1"

Comment 2 Jaroslav Mracek 2017-05-03 15:05:12 UTC
I create a pull request that only describe work around, but not solve a problem. Unfortunately we cannot do more.

Comment 3 Jaroslav Mracek 2017-05-03 15:05:35 UTC
Pull-request: https://github.com/rpm-software-management/dnf/pull/801

Comment 4 Jaroslav Mracek 2017-05-04 10:06:47 UTC
*** Bug 1428015 has been marked as a duplicate of this bug. ***

Comment 5 Fedora Update System 2017-05-11 08:59:09 UTC
dnf-2.4.1-1.fc26 has been submitted as an update to Fedora 26. https://bodhi.fedoraproject.org/updates/FEDORA-2017-e0fa49ff81

Comment 6 Fedora Update System 2017-05-13 01:10:46 UTC
dnf-2.4.1-1.fc26 has been pushed to the Fedora 26 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2017-e0fa49ff81

Comment 7 Fedora Update System 2017-05-14 20:19:41 UTC
dnf-2.4.1-1.fc26 has been pushed to the Fedora 26 stable repository. If problems still persist, please make note of it in this bug report.

Comment 8 srakitnican 2017-07-03 10:29:14 UTC
*** Bug 1467293 has been marked as a duplicate of this bug. ***

Comment 9 srakitnican 2017-07-03 10:39:29 UTC
Seems that I had dnf-2.4.1-1.fc26 installed when the upgrade failed mentioned in bug #1467293, yet I still got the same error when trying to use -1 as an argument.

Comment 10 srakitnican 2017-07-03 13:23:13 UTC
Definitely does not work for me, please retest and reopen this bug.

$ rpm -q dnf dnf-plugins-core
$ sudo dnf repoquery --duplicates --latest-limit -1 > /dev/null
Command line error: argument --latest-limit: expected one argument

Comment 11 srakitnican 2017-07-03 15:06:12 UTC
Sorry, didn't see it is not possible to fix this in current release. In a sense that is described in comment #2 it is fixed for me as well.

       --latest-limit <number>
              Limit the resulting set to <number> of latest packages for every
              package name and architecture.  If  <number>  is  negative  skip
              <number> of latest packages. If negative number is used use syn‐
              tax --latest-limit=<number>.

Comment 12 Jaroslav Mracek 2017-08-04 11:38:32 UTC
*** Bug 1467293 has been marked as a duplicate of this bug. ***

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