Closed mcrha closed 3 days ago
I am marking this as RFE as when trying with the current PackageKit backend, the situation is the same as described, download size is based on the package itself without calculating dependencies.
I'd say this works already, +/- improvements suggested at https://github.com/rpm-software-management/dnf5/pull/1626#issuecomment-2302551247
Let me close this. One get call "install", and then stop at the Goal::resolve() and examine the response with packages to be installed, where also the sizes are available. No need for an extra API, it was only that this possibility was not obvious to me.
The gnome-software can show how many bytes the app will take to download, but it shows only the main package, not its dependencies. Consider app like
hedgewars
, which also requireshedgewars-data
and possibly other.On the command line:
while gnome-software shows only 2.8MB for the Hedgewars app.
A naive solution could be to get the package dependencies and check what it'll return, at least for not-yet-installed packages (it won't cover updates, I guess), but I did not find a way to it. The
rpm.Rpm
interface allows "whatrequires", but not "requires", as I could otherwise:Nonetheless, I'm not interested in precise dependencies, the sizes (downloaded and installed) are good enough for my use case (and I do not think I could catch all the downloaded cases with the simple (and single) call to get the
requires
, because those requires can have their own requires to be installed and so on). A new package propertyinstall_size_with_deps
anddownload_size_with_deps
, both calculated on demand, only if needed (because it's an expensive operation), would do the trick too, but I understand it's too specific and single-purpose thing, thus not so great in the generic API the daemon (tries to/) does have.Maybe a "simulate-install" operation, which would return a list of the packages to be installed, if the install is executed, ideally with the sizes? Something what would mimic what the
dnf install hedgewars
table above shows.