Description of problem: https://github.com/rpm-software-management/dnf-plugins-core/commit/032c9e971f61ad4e09af98584b39dbbd8122181d added support for a --requires-pre argument to `dnf repoquery`, however there are still three other Requires(foo) types that are unhandled: * Requires(preun): * Requires(post): * Requires(postun): These dependencies are necessary to use repoquery to determine the full set of packages that would be needed to support the installation and removal of a package. Version-Release number of selected component (if applicable): https://github.com/rpm-software-management/dnf-plugins-core/commit/032c9e971f61ad4e09af98584b39dbbd8122181d How reproducible: Every time Steps to Reproduce: 1. Run `dnf repoquery --requires-post sssd-client` Actual results: Error: unrecognized arguments: --requires-post Expected results: /sbin/ldconfig /usr/sbin/alternatives Additional info: Both RPM and the old yum-based repoquery used to treat all four of these as part of "Requires" and return them all when queried with --requires. RPM still does: ``` $ rpm -q --requires sssd-client /bin/sh /bin/sh /sbin/ldconfig /sbin/ldconfig /sbin/ldconfig /usr/sbin/alternatives /usr/sbin/alternatives libc.so.6()(64bit) libc.so.6(GLIBC_2.14)(64bit) libc.so.6(GLIBC_2.2.5)(64bit) libc.so.6(GLIBC_2.3)(64bit) libc.so.6(GLIBC_2.3.4)(64bit) libc.so.6(GLIBC_2.4)(64bit) libc.so.6(GLIBC_2.7)(64bit) libc.so.6(GLIBC_2.8)(64bit) libcom_err.so.2()(64bit) libk5crypto.so.3()(64bit) libkrb5.so.3()(64bit) libkrb5.so.3(krb5_3_MIT)(64bit) libpam.so.0()(64bit) libpam.so.0(LIBPAM_1.0)(64bit) libpam.so.0(LIBPAM_EXTENSION_1.0)(64bit) libpam.so.0(LIBPAM_MODUTIL_1.0)(64bit) libpthread.so.0()(64bit) libpthread.so.0(GLIBC_2.12)(64bit) libpthread.so.0(GLIBC_2.2.5)(64bit) libsss_idmap.so.0()(64bit) libsss_idmap.so.0(SSS_IDMAP_0.4)(64bit) libsss_nss_idmap.so.0()(64bit) libsss_nss_idmap.so.0(SSS_NSS_IDMAP_0.0.1)(64bit) rpmlib(CompressedFileNames) <= 3.0.4-1 rpmlib(FileDigests) <= 4.6.0-1 rpmlib(PayloadFilesHavePrefix) <= 4.0-1 rpmlib(PayloadIsXz) <= 5.2-1 rtld(GNU_HASH) ```
Unfortunately the full rpm-level Requires(pre,post,preun,postun) dependencies are not available at the repodata level, it only has a notion of "pre-requires" which includes Requires(pre,post) type dependencies. Requires(preun,postun) are considered just regular dependencies in repodata. Dnf cannot query data that just is not there, fixing this would require changes to the repodata format and all the tooling sitting on top of it.
(In reply to Panu Matilainen from comment #1) > Unfortunately the full rpm-level Requires(pre,post,preun,postun) > dependencies are not available at the repodata level, it only has a notion > of "pre-requires" which includes Requires(pre,post) type dependencies. > Requires(preun,postun) are considered just regular dependencies in repodata. > > Dnf cannot query data that just is not there, fixing this would require > changes to the repodata format and all the tooling sitting on top of it. OK, just to make sure I parsed that correctly: When I do a `dnf repoquery --requires-pre`, that actually returns both "Requires(pre):" and "Requires(post):" together, and `dnf repoquery --requires` returns all of "Requires:", "Requires(preun):" and "Requires(postun):"? If that's the case, then I can work with that. Thanks!
(In reply to Stephen Gallagher from comment #2) > OK, just to make sure I parsed that correctly: > > When I do a `dnf repoquery --requires-pre`, that actually returns both > "Requires(pre):" and "Requires(post):" together, and `dnf repoquery > --requires` returns all of "Requires:", "Requires(preun):" and > "Requires(postun):"? Correctly parsed, that's what I meant. > If that's the case, then I can work with that. Thanks! ...but whether that fully matches with current reality is another question. Looking at sssd-client on F24: [root@sopuli ~]# rpm -qv --requires sssd-client|grep / post,interp: /bin/sh preun,interp: /bin/sh post: /sbin/ldconfig postun: /sbin/ldconfig postun,interp: /sbin/ldconfig post: /usr/sbin/alternatives preun: /usr/sbin/alternatives [root@sopuli ~]# This is what repodata says about it: <rpm:requires> <rpm:entry name="/bin/sh"/> <rpm:entry name="/bin/sh" pre="1"/> <rpm:entry name="/sbin/ldconfig"/> <rpm:entry name="/sbin/ldconfig" pre="1"/> <rpm:entry name="/usr/sbin/alternatives"/> <rpm:entry name="/usr/sbin/alternatives" pre="1"/> ... </rpm:requires> Which does match what I said, half of them are pre-requires and the other half (which would be those preun and postun deps) are not. However dnf-1.1.10-1.fc24.noarch doesn't see *any* of them: [root@sopuli ~]# dnf repoquery --requires sssd-client|grep / [root@sopuli ~]#
(In reply to Panu Matilainen from comment #3) > (In reply to Stephen Gallagher from comment #2) > > OK, just to make sure I parsed that correctly: > > > > When I do a `dnf repoquery --requires-pre`, that actually returns both > > "Requires(pre):" and "Requires(post):" together, and `dnf repoquery > > --requires` returns all of "Requires:", "Requires(preun):" and > > "Requires(postun):"? > > Correctly parsed, that's what I meant. > > > If that's the case, then I can work with that. Thanks! > > ...but whether that fully matches with current reality is another question. > Looking at sssd-client on F24: > > [root@sopuli ~]# rpm -qv --requires sssd-client|grep / > post,interp: /bin/sh > preun,interp: /bin/sh > post: /sbin/ldconfig > postun: /sbin/ldconfig > postun,interp: /sbin/ldconfig > post: /usr/sbin/alternatives > preun: /usr/sbin/alternatives > [root@sopuli ~]# > > This is what repodata says about it: > <rpm:requires> > <rpm:entry name="/bin/sh"/> > <rpm:entry name="/bin/sh" pre="1"/> > <rpm:entry name="/sbin/ldconfig"/> > <rpm:entry name="/sbin/ldconfig" pre="1"/> > <rpm:entry name="/usr/sbin/alternatives"/> > <rpm:entry name="/usr/sbin/alternatives" pre="1"/> > ... > </rpm:requires> > > Which does match what I said, half of them are pre-requires and the other > half (which would be those preun and postun deps) are not. However > dnf-1.1.10-1.fc24.noarch doesn't see *any* of them: > > [root@sopuli ~]# dnf repoquery --requires sssd-client|grep / > [root@sopuli ~]# Right, DNF 1.1.10 doesn't have the support for requires(pre); that's been added in DNF 2.0: https://github.com/rpm-software-management/dnf-plugins-core/commit/032c9e971f61ad4e09af98584b39dbbd8122181d In DNF 2.0, it also requires `dnf repoquery --requires-pre`, not just `--requires`. That's a different behavior from yum, but I haven't got an opinion on whether that's an issue for others; for me, I don't care if I have to add an extra flag.
Yes, those pre="1" deps missing is expected. But it *should* see the ones without it, so there's a bug somewhere. Based on the repodata, both these: # dnf repoquery --requires sssd-client|grep / and # dnf repoquery --requires-pre sssd-client|grep / ...should return: /bin/sh /sbin/ldconfig /usr/sbin/alternatives If that's the case in dnf 2.0 then good, dnf 1.1.10 is buggy wrt --requires at least.
On Rawhide just now: # dnf repoquery --requires sssd-client Last metadata expiration check: 0:21:35 ago on Thu Oct 06 08:43:41 2016 EDT. libc.so.6(GLIBC_2.14)(64bit) libc.so.6(GLIBC_2.8) libcom_err.so.2 libcom_err.so.2()(64bit) libk5crypto.so.3 libk5crypto.so.3()(64bit) libkrb5.so.3 libkrb5.so.3()(64bit) libkrb5.so.3(krb5_3_MIT) libkrb5.so.3(krb5_3_MIT)(64bit) libpam.so.0 libpam.so.0()(64bit) libpam.so.0(LIBPAM_1.0) libpam.so.0(LIBPAM_1.0)(64bit) libpam.so.0(LIBPAM_EXTENSION_1.0) libpam.so.0(LIBPAM_EXTENSION_1.0)(64bit) libpam.so.0(LIBPAM_MODUTIL_1.0) libpam.so.0(LIBPAM_MODUTIL_1.0)(64bit) libpthread.so.0 libpthread.so.0()(64bit) libpthread.so.0(GLIBC_2.0) libpthread.so.0(GLIBC_2.12) libpthread.so.0(GLIBC_2.12)(64bit) libpthread.so.0(GLIBC_2.2) libpthread.so.0(GLIBC_2.2.5)(64bit) libsss_idmap.so.0 libsss_idmap.so.0()(64bit) libsss_idmap.so.0(SSS_IDMAP_0.4) libsss_idmap.so.0(SSS_IDMAP_0.4)(64bit) libsss_nss_idmap.so.0 libsss_nss_idmap.so.0()(64bit) libsss_nss_idmap.so.0(SSS_NSS_IDMAP_0.0.1) libsss_nss_idmap.so.0(SSS_NSS_IDMAP_0.0.1)(64bit) rtld(GNU_HASH) # dnf repoquery --requires-pre sssd-client Last metadata expiration check: 0:21:40 ago on Thu Oct 06 08:43:41 2016 EDT. /bin/sh /sbin/ldconfig /usr/sbin/alternatives So it looks like you're right; the preun and postun stuff isn't showing up in the regular --requires, which is probably a bug. Shall we retitle this BZ?
(In reply to Stephen Gallagher from comment #6) > So it looks like you're right; the preun and postun stuff isn't showing up > in the regular --requires, which is probably a bug. Shall we retitle this BZ? Might as well do, at least there's plenty of information here already :)
There are 2 kind of bugs. 1) (most probably in librepo) that it filters out post/postun/etc. from --requires 2) it's not completely compatible with yum-repoquery, so I think we will merge output back to --requires
Here is the patch that should help https://github.com/rpm-software-management/libdnf/pull/279
dnf-plugins-core-2.0.0-1.fc26 libdnf-0.8.2-1.fc26 dnf-2.4.0-1.fc26 has been submitted as an update to Fedora 26. https://bodhi.fedoraproject.org/updates/FEDORA-2017-4e95959f0d
dnf-2.4.0-1.fc26 dnf-plugins-core-2.0.0-1.fc26 dnf-plugins-extras-2.0.0-1.fc26 libdnf-0.8.2-1.fc26 has been submitted as an update to Fedora 26. https://bodhi.fedoraproject.org/updates/FEDORA-2017-4e95959f0d
dnf-2.4.0-1.fc26, dnf-plugins-core-2.0.0-1.fc26, dnf-plugins-extras-2.0.0-1.fc26, libdnf-0.8.2-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-4e95959f0d
dnf-2.4.0-1.fc26, dnf-plugins-core-2.0.0-1.fc26, dnf-plugins-extras-2.0.0-1.fc26, libdnf-0.8.2-1.fc26 has been pushed to the Fedora 26 stable repository. If problems still persist, please make note of it in this bug report.