Bug 1784148

Summary: dnf deplist is not returning linux-firmware dependency
Product: Red Hat Enterprise Linux 8 Reporter: Marco Patalano <mpatalan>
Component: dnfAssignee: Jaroslav Mracek <jmracek>
Status: CLOSED ERRATA QA Contact: Radek Bíba <rbiba>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 8.2CC: amatej, bgoncalv, james.antill
Target Milestone: rcKeywords: Triaged
Target Release: 8.2Flags: pm-rhel: mirror+
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: dnf-4.2.17-6.el8 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-04-28 16:49:06 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 Marco Patalano 2019-12-16 20:00:52 UTC
Description of problem: As part of an env_setup script, one of our automation jobs runs the following command to check for dependencies prior to upgrading the kernel:

dnf deplist http://download-node-02.eng.bos.redhat.com/brewroot/packages/kernel/4.18.0/165.el8/x86_64/kernel-4.18.0-165.el8.x86_64.rpm | grep "dependency:" | awk '{print$2"-"$4}'
Last metadata expiration check: 0:29:56 ago on Mon 16 Dec 2019 09:42:32 AM EST.

In this particular case, no dependencies are being returned. As a result, when the script proceeds to install the kernel, it is failing with the following:

Error: 
 Problem 1: conflicting requests
  - nothing provides linux-firmware >= 20191202-96.gite8a0f4c9 needed by kernel-core-4.18.0-165.el8.x86_64

Using rpm -qp, I can see the linux-firmware dependency:

# rpm -qp --requires http://download-node-02.eng.bos.redhat.com/brewroot/packages/kernel/4.18.0/165.el8/x86_64/kernel-core-4.18.0-165.el8.x86_64.rpm
/bin/sh
/bin/sh
/bin/sh
/usr/bin/kernel-install
coreutils
dracut >= 027
linux-firmware >= 20191202-96.gite8a0f4c9
rpmlib(CompressedFileNames) <= 3.0.4-1
rpmlib(FileDigests) <= 4.6.0-1
rpmlib(PayloadFilesHavePrefix) <= 4.0-1
rpmlib(PayloadIsXz) <= 5.2-1
systemd >= 200
systemd >= 203-2

I am using the following version of dnf:
# rpm -qa dnf
dnf-4.2.17-2.el8.noarch

Version-Release number of selected component (if applicable):
dnf-4.2.17-2.el8.noarch

Comment 1 Marco Patalano 2019-12-16 20:07:21 UTC
Just ran a quick test on my RHEL-7.5 PC and get the following with yum deplist:

$ yum deplist http://download-node-02.eng.bos.redhat.com/brewroot/packages/kernel/4.18.0/165.el8/x86_64/kernel-core-4.18.0-165.el8.x86_64.rpm
Loaded plugins: changelog, fs-snapshot, priorities, refresh-packagekit, rhnplugin, rpm-warm-cache, verify
*Note* Spacewalk repositories are not listed below. You must run this command as root to access Spacewalk repositories.
Repository google-chrome is listed more than once in the configuration
Repository google-talkplugin is listed more than once in the configuration
kernel-core-4.18.0-165.el8.x86_64.rpm                                                                                                                                                                                  |  28 MB  00:00:02     
package: kernel-core.x86_64 4.18.0-165.el8
  dependency: /bin/sh
   Unsatisfied dependency
  dependency: /usr/bin/kernel-install
   Unsatisfied dependency
  dependency: coreutils
   Unsatisfied dependency
  dependency: dracut >= 027
   Unsatisfied dependency
  dependency: linux-firmware >= 20191202-96.gite8a0f4c9
   Unsatisfied dependency
  dependency: systemd >= 200
   Unsatisfied dependency
  dependency: systemd >= 203-2
   Unsatisfied dependency

Comment 3 Daniel Mach 2019-12-19 13:23:19 UTC
The problem is that dnf deplist doesn't download the package to inspect and it always exists with 0:

$ dnf deplist http://download-node-02.eng.bos.redhat.com/brewroot/packages/kernel/4.18.0/165.el8/x86_64/kernel-4.18.0-165.el8.x86_64.rpm
$ echo $?
0

The expected behavior is:
$ dnf deplist http://download-node-02.eng.bos.redhat.com/brewroot/packages/kernel/4.18.0/165.el8/x86_64/kernel-4.18.0-165.el8.x86_64.rpm
package: kernel-4.18.0-165.el8.x86_64
  dependency: kernel-core-uname-r = 4.18.0-165.el8.x86_64
   provider: kernel-core-4.18.0-165.el8.x86_64
  dependency: kernel-modules-uname-r = 4.18.0-165.el8.x86_64
   provider: kernel-modules-4.18.0-165.el8.x86_64
$ echo $?
0

or

$ dnf deplist http://example.com/does-not-exist
Error: Could not download http://example.com/does-not-exist
$ echo $?
1 (or any other non-zero exit code)

Comment 4 Jaroslav Mracek 2020-01-03 11:02:56 UTC
I create a patch that adds support of local packages for repoquery command (https://github.com/rpm-software-management/dnf/pull/1564). The `deplist` command is only alias for `yum repoquery --deplist`.

Tests: https://github.com/rpm-software-management/ci-dnf-stack/pull/747

Comment 12 errata-xmlrpc 2020-04-28 16:49:06 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2020:1823