rpm-software-management / dnf

Package manager based on libdnf and libsolv. Replaces YUM.
GNU General Public License v2.0
1.25k stars 418 forks source link

Difficulty extracting data from updateinfo output #1893

Open jcpunk opened 1 year ago

jcpunk commented 1 year ago

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.

kontura commented 1 year ago

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.

jcpunk commented 1 year ago

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.

j-mracek commented 1 year ago

We plan to add machine readable outputs to DNF5