Bugzilla – Bug 410897
Make calculation of total used/freed disk space after pkg installation accessible outside zypper
Last modified: 2018-04-13 17:17:14 UTC
Before confirming package installation/removal, zypper prints a nice summary that looks like: "Overall download size X.Y M, after the operation A.B M will be used" (similarly for pkg removal). Zypper calculates these numbers by iterating over all resolvables with to_be_installed/to_be_removed flag and summing up their sizes. Total download size is calculated also in YCP pkg-bindings (where it is slightly more complicated by summing up the sizes by different repositories - anyway, don't fully understand that :) ). Now I'd like to re-use this functionality (show the user how much MBs will be downloaded, installed, deleted) also in ncurses-pkg. There is several years old bloated code in patch selector that i) calculates total download size, ii) does the iteration over all selectables for every single patch status change, which is extremely clumsy iii) this is actually the third place where +- the same code is used Could the code which is used in zypper please be moved somewhere else, so that it can be re-used in pkg selectors and/or pkg-bindings? It could, for example, have the form of the functions returning the sums in zypp::ByteCount for total download size, installed size, and removed size (if applicable)
This is really desirable. It could be implemented in a form of a PoolStatistics class, which would lazily compute them on request from the current pool. It could have methods like computeAll(), getDownloadSize() (taking deltarpms into account by checking their availability bug #325922), getTargetSpaceChange(), getToInstallSize(), getToInstallCount(ResKind), getToUpgradeCount(ResKind), etc...
I'll take care of this while doing bug #389128.
11.1 -> 11.4
Space computation is still an issue.
*** Bug 551678 has been marked as a duplicate of this bug. ***
This is automated batch bugzilla cleanup. The openSUSE Tumbleweed changed its development model at the end of year 2014. [1] Which means that most of the older bugs are reported against completely different product than the current release of openSUSE Tumbleweed. There is very high probability that this bug is no-longer relevant at all. As a result we are closing this bug. If you can reproduce this bug against a current Tumbleweed installation of openSUSE, or you can still observe it under openSUSE Leap 15.0, please feel free to reopen this bug. Thank you for reporting this bug and we are sorry it was not resolved under the old product. [1] https://en.opensuse.org/Portal:Tumbleweed