dnf icon indicating copy to clipboard operation
dnf copied to clipboard

Difficulty extracting data from updateinfo output

Open jcpunk opened this issue 2 years ago • 3 comments

The updateinfo --verbose helpfully outputs the dates of the advisories. That is something I need to use to track if I've installed updates with my window.

Unfortunately, that also provides a bunch of debugging information for dnf. I'd also rather not try and build tooling that figures out which repos pulled down new metadata and printed that operation to stdout.

I'm really just looking for the output from https://github.com/rpm-software-management/dnf/blob/master/dnf/cli/commands/updateinfo.py#L348 and nothing else.

It seems I can have --quiet mode and no dates, or --verbose mode and a ton of extra data along with my dates.

I'll confess, some sort of json output mode would make my day.

jcpunk avatar Feb 02 '23 21:02 jcpunk

Not sure if this helps you right now but in dnf5 (which is in rawhide or in our COPR) we have included the date in regular output. It looks like:

Name                   Type        Severity                  Package              Issued
FEDORA-2018-318f184112 enhancement Moderate flac-1.4.0-1.fc29.x86_64 2019-01-19 00:00:00
FEDORA-2999:002-02     enhancement Moderate flac-1.3.3-8.fc29.x86_64 2019-01-17 00:00:00

Also dnf5 has API for working with advisories which might be better for your use case instead of parsing the output. Unfortunately it is not available in python yet but it definitely will be.

kontura avatar Feb 07 '23 08:02 kontura

Having the date column there is nice!

I wonder if having some sort of structured text output might be handy for figuring out which packages are actually in the update. For some packages I can split on the first -, but for others....

Being able to say "There is a security update for this installed package" would be handy. For example if there is a bugfix for openssh-server I may not care, but a security patch would be something I'd want to jump on. Similarly, I may not be too worried about a security update for yelp-xsl and willing to wait a few weeks on that.

jcpunk avatar Feb 08 '23 20:02 jcpunk

We plan to add machine readable outputs to DNF5

j-mracek avatar Sep 12 '23 13:09 j-mracek