dnf5 icon indicating copy to clipboard operation
dnf5 copied to clipboard

API to get information about available updates

Open abitrolly opened this issue 4 years ago • 9 comments

Need API to get immediate info about updates. Without waiting for caches to refresh.

(for example for https://github.com/osquery/osquery/issues/5201)

abitrolly avatar Aug 11 '20 18:08 abitrolly

This seems to have no parent now, therefore closing this.

jan-kolarik avatar Mar 11 '24 10:03 jan-kolarik

@jan-kolarik by parent do you mean https://github.com/osquery/osquery/issues/5201 ? I edited the description to clarify that it is not the parent. Please reopen.

abitrolly avatar Mar 12 '24 16:03 abitrolly

@jan-kolarik thanks! ;)

abitrolly avatar Mar 12 '24 16:03 abitrolly

Sure, reopened. Do I understand correctly that this involves providing an API similar to what the check-upgrade command does? Essentially, it's a combination of several package queries. While there isn't currently a single helper method for this functionality, it could potentially be created.

jan-kolarik avatar Mar 12 '24 16:03 jan-kolarik

Yes, but check-upgrade has not enough info.

~ sudo dnf5 check-upgrade
[sudo] password for anatoli: 
Sorry, try again.
[sudo] password for anatoli: 
Sorry, try again.
[sudo] password for anatoli: 
Updating and loading repositories:
 Fedora 39 - x86_64 - Updates                                                                                                     100% |  17.1 KiB/s |  19.2 KiB |  00m01s
 Fedora 39 - x86_64 - Updates                                                                                                     100% | 756.1 KiB/s |   3.0 MiB |  00m04s
Repositories loaded.
libusb1.x86_64         1.0.27-1.fc39 updates
rpm-ostree-libs.x86_64 2024.3-3.fc39 updates

What is needed is.

  • name
  • old, new version
  • one line description
  • changes
  • if the update is critical
  • what packages are system installed (blue), what are user installed (yellow) and what are their automatic dependencies (white)

(taken from my notes while trying to build update viewer https://gitlab.com/abitrolly/dnf-go-gui)

abitrolly avatar Mar 12 '24 16:03 abitrolly

So you want "dnf5 --cacheonly --assumeno upgrade" combined with "dnf5 check-upgrade" with additional details in a single API call. I don't think there will ever be something like that. It's to much specific use case. You can obtain list of packages to update and then query for the details of each package separately.

Check "dnf5daemon-client upgrade" command. It uses D-Bus API and the output is similar what dnf5 tool prints. So there is a high change than many of the details are already obtainable through API. Of course not a single call.

ppisar avatar Mar 12 '24 16:03 ppisar

@ppisar that's why I want ERD diagram for the database to query it directly,

https://github.com/rpm-software-management/dnf5/issues/1243#issuecomment-1991721940

abitrolly avatar Mar 12 '24 21:03 abitrolly

@abitrolly May I ask you whether you need C++ or a Python code?

j-mracek avatar Mar 14 '24 08:03 j-mracek

@j-mracek it was Python, but then I switched to Go.

abitrolly avatar Mar 14 '24 09:03 abitrolly