dnf5
dnf5 copied to clipboard
API to get information about available updates
Need API to get immediate info about updates. Without waiting for caches to refresh.
(for example for https://github.com/osquery/osquery/issues/5201)
This seems to have no parent now, therefore closing this.
@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.
@jan-kolarik thanks! ;)
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.
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)
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 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 May I ask you whether you need C++ or a Python code?
@j-mracek it was Python, but then I switched to Go.