Skip to content

updateinfo: match packages by NEVRA, not just name #2303

@pranlawate

Description

@pranlawate

Problem

The dnf updateinfo command only matches advisory packages by name. When a user specifies a package with version information (e.g. dnf updateinfo openssl-1:3.5.1-7.el10_1.x86_64 --info --all), no results are returned because the matching logic only compares apackage.name against the spec.

This forces users to run two commands to get advisory details for a specific package build:

  1. dnf updateinfo <name> --list --all to find the advisory ID for their version
  2. dnf updateinfo <advisory-id> info to get the details

Expected behavior

dnf updateinfo <name-version-release.arch> --info --all should return only the advisories that apply to that specific package build.

Proposed fix

Extend the package matching in _apackage_advisory_installed() to also try matching the spec against the full NEVRA (name-epoch:version-release.arch), NVR, and epoch-stripped variants. This handles the common case where users omit the epoch.

Tested on RHEL 10 with openssl advisories -- correctly filters to exact build.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Priority:LOWRFERequest for Enhancement (as opposed to a bug)triaged

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions