Bug 1296625

Summary: [RFE] dnf repoquery --recursive with same functionality as in yum
Product: [Fedora] Fedora Reporter: Petr Spacek <pspacek>
Component: dnf-plugins-coreAssignee: rpm-software-management
Status: CLOSED EOL QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: low    
Version: 23CC: dkupka, jmracek, jsilhan, mluscon, mmraka, packaging-team-maint, pnemade, psabata, pspacek, RadekHolyPublic, trevor, vmukhame
Target Milestone: ---Keywords: EasyFix, FutureFeature, Triaged
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-12-20 17:40:35 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 Petr Spacek 2016-01-07 16:49:13 UTC
dnf repoquery currently does not support --recursive option known from yum repoquery.

This option is hugely useful for listing whole dependency trees when attempting to trim dependencies etc.

Comment 1 Honza Silhan 2016-01-11 13:08:15 UTC
isn't `--tree` option what you need or do you need unformated list of unique packages?

Comment 2 Petr Spacek 2016-01-19 16:15:08 UTC
even unformated list of packages would be sufficient, I can pipe it into sort -u myself :-)

Comment 3 Fedora Admin XMLRPC Client 2016-07-08 09:25:42 UTC
This package has changed ownership in the Fedora Package Database.  Reassigning to the new owner of this component.

Comment 4 Fedora End Of Life 2016-11-24 14:45:53 UTC
This message is a reminder that Fedora 23 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 23. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as EOL if it remains open with a Fedora  'version'
of '23'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 23 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

Comment 5 Michael Mráka 2016-11-28 13:44:53 UTC
Isn't
 dnf repoquery --whatrequires --alldeps <package>
what you are lookign for?

Comment 6 Petr Spacek 2016-11-28 15:46:53 UTC
Hard to say, I do not see that option documented on
https://rpm-software-management.github.io/dnf-plugins-core/repoquery.html :-)

Comment 7 Jaroslav Mracek 2016-12-12 19:40:51 UTC
Here is the link to new documentation pages:
https://dnf.readthedocs.io/en/latest/command_ref.html#repoquery-command-label

The page that you mentioned above I haven't seen it before. Additionally I have to inform you that repoquery command is part of dnf from dnf version 2.0 (rawhide). 

Please can you try the rawhide version or version from our testing repository ('dnf copr enable rpmsoftwaremanagement/dnf-nightly') if requested output is sufficient for your user case.

Comment 8 Petr Spacek 2016-12-15 16:51:01 UTC
I just tested it with dnf-2.0.0_0.rc2.1-18g5f8fbdd.fc24.noarch from nightly repo.

What I wanted to achieve is basically recursive version of:
dnf repoquery --resolve --requires freeipa-server*

So, it is not exactly what I wanted but luckily enough this should be easy enough to wrap in a shell script which would call repoquery repeatedly until it walks over the tree.

Thank you!

Comment 9 Fedora End Of Life 2016-12-20 17:40:35 UTC
Fedora 23 changed to end-of-life (EOL) status on 2016-12-20. Fedora 23 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this
bug.

Thank you for reporting this bug and we are sorry it could not be fixed.

Comment 10 Jaroslav Mracek 2017-04-05 08:19:54 UTC
The recursive option was will be implemented in dnf-2.3.0.

Comment 11 Trevor Cordes 2017-04-24 07:18:27 UTC
Petr Spacek, I too am trying to recover some of the functionality that yum gave in recursive requires/provides output, mostly in tree format.

I've gotten F24's dnf 1.1.10-4 to give me some usable output with:

dnf repoquery --whatrequires bash --installed --arch=$MACHTYPE,noarch --tree --resolve

Took me a long time to get the syntax right.  Replace "bash" with the package of choice.  The output is ugly, but perfect for a script.  Note, the above command shows "down the tree", i.e. what is shown requires bash.  To go "up the tree" use --requires (I think); it's all quite confusing!

That last thing I need to solve is how to get my above command to show me just the base package name with no version at all (i.e. show me dracut not dracut-044-21...), as stripping off the version isn't as easy as looking for "dash number".  In yum I used to combine the --tree-whatrequires option with -qf="%{name}" but the new --qf and --tree seem mutually exclusive (tree just ignores qf now).  Time to look at the source...

Comment 12 Trevor Cordes 2017-04-24 08:13:24 UTC
Follow-up: checked the source, turns out --tree hardcodes the format and ignores --qf as I suspected.  So I added --qf support to --tree and put up a patch in a new bz: bug# 1444751

With this it should now be possible in the current F24/25 version of dnf to get similar results as yum used to give with recursive/resolve, at least in my use case.

Comment 13 Trevor Cordes 2017-04-24 08:42:16 UTC
Sorry to bug the bugzilla again, but you also need "--alldeps" in there for some reason or some weird subset of the deps are shown.  This is very weird as the man page says "alldeps" is the default (may be a new bug?).  So you want something like:

dnf repoquery --whatrequires gtk2 --alldeps --installed -arch=$MACHTYPE,noarch --tree --queryformat '%{name}' --resolve

Ah!  Now my nice script that links into graphviz to give me a pretty graph picture of a package's deps works again (broken since dnf took over).

Comment 14 Jaroslav Mracek 2017-04-24 11:15:54 UTC
Trevor, please if any new issue appears, please create the new bugzilla because this bug is closed and can be easily overlooked. Thanks a lot.

Comment 15 Jaroslav Mracek 2017-04-24 11:19:46 UTC
The --alldeps as default is valid for dnf-2.x but not for dnf-1.1.x . Latest DNF can be installed for our test repository (dnf copr enable rpmsoftwaremanagement/dnf-nightly)