Bug 1393704 - [RFE] add 'rpm -q --whatrequires --all-deps' functionality
Summary: [RFE] add 'rpm -q --whatrequires --all-deps' functionality
Keywords:
Status: CLOSED UPSTREAM
Alias: None
Product: Fedora
Classification: Fedora
Component: rpm
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Packaging Maintenance Team
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
: 142651 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-11-10 08:07 UTC by Pavel Raiskup
Modified: 2023-03-24 08:27 UTC (History)
7 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2023-03-24 07:12:55 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github rpm-software-management rpm issues 2450 0 None open RFE: resolve --what<depends> argument to package provides 2023-03-24 07:12:54 UTC
Red Hat Bugzilla 1642031 0 unspecified CLOSED major: rpm does not give out dependencies when asked 2021-02-22 00:41:40 UTC

Internal Links: 1642031

Description Pavel Raiskup 2016-11-10 08:07:58 UTC
Based on fedora devel [1] list, there's neat dnf's functionality:

  $ dnf repoquery --whatrequires libarchive --alldeps --installed

But it would be nice to have something like '--whatrequires --alldeps'
option directly in RPM (unless that's already there).

[1] https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org/message/XI2JCLX5CIFWCJNKAV23KRESCQGT54RO/

Comment 1 Igor Gnatenko 2016-11-10 08:36:59 UTC
$ rpm -q --provides libarchive | awk '{print $1}' | xargs rpm -q --whatrequires

Comment 2 Pavel Raiskup 2016-11-10 09:01:39 UTC
Yep, something like that could solve RPM directly.

Comment 3 Panu Matilainen 2016-11-10 10:46:17 UTC
This is technically a dupe of bug 142651 which is a dupe of bug 84176 which easily predates repoquery but I never much cared for the suggested --whatneeds name. What a software *needs* is users, what it *requires* to function is an entirely different question, and whether the requirements are depsolved or not is yet another question.

repoquery (the yum-based one) originally mimiced rpm but then sanity prevailed:

> commit bc3d026acd1c8f332d024bf9a9918da6451c8c07
> Author: Ville Skyttä <ville.skytta>
> Date:   Tue Feb 9 21:35:15 2010 +0200
>
>    Make --alldeps the default in repoquery.
>    
>    --alldeps is what people really almost always want, but fail to
>    specify for some reason.  --exactdeps can be used to get the previous
>    default of exact matching.

Not sure what dnf repoquery does but from the sound of this, it's defaulting to the stupid rpm behavior which almost nobody wants.

So what rpm really needs is a switch to enable/disable depsolve on all those --whatrequires/recommends etc options, which is what this bug describes in clear and conscise matter. So to keep in tradition of closing the older bug as dupe ;) I'm keeping this one.

There's also another way to get rpms opinion:

    $ rpm -e --test rpm-libs 2>&1 | awk '/^\t/ {print $NF}'

That is subtly different from the --provides/--whatrequires combination in comment #1 as --test considers the %pre/%post dependency differences (ie its a real dependency check), --provides/--whatrequires does not.

Comment 4 Panu Matilainen 2016-11-10 10:53:33 UTC
*** Bug 142651 has been marked as a duplicate of this bug. ***

Comment 5 Igor Gnatenko 2016-11-10 11:07:45 UTC
(In reply to Panu Matilainen from comment #3)
> repoquery (the yum-based one) originally mimiced rpm but then sanity
> prevailed:
> 
> > commit bc3d026acd1c8f332d024bf9a9918da6451c8c07
> > Author: Ville Skyttä <ville.skytta>
> > Date:   Tue Feb 9 21:35:15 2010 +0200
> >
> >    Make --alldeps the default in repoquery.
> >    
> >    --alldeps is what people really almost always want, but fail to
> >    specify for some reason.  --exactdeps can be used to get the previous
> >    default of exact matching.
> 
> Not sure what dnf repoquery does but from the sound of this, it's defaulting
> to the stupid rpm behavior which almost nobody wants.
Since DNF 2.0, it's not true anymore.

Comment 6 Panu Matilainen 2016-11-10 11:11:58 UTC
(In reply to Igor Gnatenko from comment #5)
> (In reply to Panu Matilainen from comment #3)
> > Not sure what dnf repoquery does but from the sound of this, it's defaulting
> > to the stupid rpm behavior which almost nobody wants.
> Since DNF 2.0, it's not true anymore.

Good.

So once again history repeats itself :)

Comment 7 Panu Matilainen 2023-03-24 07:12:55 UTC
Moving the RFE to upstream.

Comment 8 Panu Matilainen 2023-03-24 08:27:43 UTC
https://github.com/rpm-software-management/rpm/pull/2451

If you want to provide feedback on the defaults, naming and the like, this is the once-in-a-lifetime chance :D


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