-
Notifications
You must be signed in to change notification settings - Fork 86
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
daemon: New API to get download size of pkg including deps #1626
Conversation
This can be used to get the "cost" of installation of a package - how much data needs to be downloaded and how much disk space will be used.
This is only a POC. @mcrha, @jan-kolarik, do you consider this worth having? |
Having something like this would work for me. Being able to verify whether the install will work and how much it'll "cost" is a good idea. Having there The name By the way, it can sometimes fail with the GPG key not being installed/updated yet. Will that break the check/simulation completely, like the call returning failure/nothing? The call can take a long time, due to dependency resolution, slow connection to update local caches and such. That can easily cause timeout on the D-Bus call. I set indefinite timeout in some cases in the gnome-software, thus not a big deal, I'm only mentioning it as a possible bottleneck for any archive reader. |
Hmm, but there are already Anyway it seems to me that both |
Aha, it's what Marek meant, there is already a way to do this, it's only hidden with two D-Bus calls. I do not like code duplication, thus ideally share the code. While a dedicated function makes it clearer how to achieve that, that not-so-obvious-two-calls works for me too. Looking on what Jan pointed to, that part does a lot more things. My comment about customizable |
I considered extending the |
I agree, that would be a giant performance hit. Better to let the API user decide which package(s) it should check and which not, which is perfectly fine to do with a "simulate" of the |
I tried the
Thus, from my point of view, this change is not needed. What would be good to have are two things:
|
From my previous comment, the |
The new API simulates install operation on given pkg returning all dependencies that are going to be installed with their sizes.
Changes:
be3c8b6 (Marek Blaha, 49 seconds ago)
dnfdaemon: Example of Rpm.check_install() usage
be9411b (Marek Blaha, 4 minutes ago)
dnfdaemon: API to get download size including dependencies
This can be used to get the "cost" of installation of a package - how much
data needs to be downloaded and how much disk space will be used.
Resolves: #1593