Bug 1651408 - dnf repoquery --available listing installed packages as well
Summary: dnf repoquery --available listing installed packages as well
Keywords:
Status: CLOSED CANTFIX
Alias: None
Product: Fedora
Classification: Fedora
Component: dnf
Version: 29
Hardware: All
OS: Linux
unspecified
low
Target Milestone: ---
Assignee: Jaroslav Mracek
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-11-20 01:52 UTC by guillaume.viry
Modified: 2018-11-27 19:36 UTC (History)
7 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-11-27 19:36:24 UTC


Attachments (Terms of Use)

Description guillaume.viry 2018-11-20 01:52:26 UTC
dnf repoquery does not seem to behave in a consistent way compared to dnf list for instance.
Even from the command help, we have for 'list'
[--all | --available | --installed | --extras | --updates | --up
grades | --autoremove | --recent]
whereas we get for 'repoquery'
[--available]
[--installed | --extras | --upgrades | --unneeded | --userinstalled]

The 'available' is not mutually exclusive with 'installed' anymore, and just matches all packages, regardless of their install status
.
On my system, freshly updated to Fedora 29, I get the following:
[guillaume@fedora ~]$ dnf repoquery --available|wc -l
70865
[guillaume@fedora ~]$ dnf repoquery --installed|wc -l
2144
[guillaume@fedora ~]$ dnf repoquery|wc -l
70865

Comment 1 Jaroslav Mracek 2018-11-21 14:43:11 UTC
I would like to provide some information.

dnf repoquery
# shows only available packages

dnf repoquery --available
# shows only available packages

dnf repoquery --installed
# shows only installed packages

dnf repoquery --available --installed
# shows only available and installed packages

I think that the current behavior is fine and we should not unify outputs with "dnf list" because the usage is different. We also should not change the current behavior of repoquery because a lot of automatic scripts depend on it. Please if you think that the explanation did not solve your issue, please reopen the bug report with additional information like why the requested change is important or how it effect wide amount of users.

Comment 2 guillaume.viry 2018-11-21 23:42:22 UTC
In that case, I guess the problem is that we change the meaning of "available" between different commands.
In dnf list, available stands for "not installed and in repository".
In repoquery, if it stands just for "in repository", perhaps that should be written in the help strings.
The purpose of my report wasn't to unify output format or whatever, but to point to the difference of semantics for the "available" argument.

Comment 3 guillaume.viry 2018-11-22 04:01:29 UTC
Ok, I get that from my initial report, it might be ambiguous, so please let me rephrase it.
My problem is not with "--available" being enabled by default.
My problem is with "--available" returning already installed packages in the results.
I hope that it is easier to understand this way.

Comment 4 Jaroslav Mracek 2018-11-27 19:36:24 UTC
I do understand your argument, but we have to keep yum compatibility. "dnf list --available" command should work like  "yum-deprecated list --available" and "dnf repoquery --available" like yum plugin repoquery. We really cannot break the behavior.


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