-
Notifications
You must be signed in to change notification settings - Fork 93
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
dnf5: Statistics: total and downloaded pkgs size, installed and freed space #378
dnf5: Statistics: total and downloaded pkgs size, installed and freed space #378
Conversation
476982e
to
4a7baa1
Compare
7391c69
to
f3dd6c6
Compare
The code is ready, but we need to agree on the output format. Below are examples of the old DNF output and my suggestion of how the new output might look. However, we need to discuss the actual form of the new output.
Mising information about used space. DNF5:
Mising information about used space. DNF5:
DNF5:
DNF5:
|
f3dd6c6
to
d4d0148
Compare
For me, it seems OK in most cases. But for the |
@jan-kolarik Thanks. I thinking about these changes:
|
I am also wondering about the line for the |
FWIW, on the API we use inbound/outbound terminology. Need to get 13.0 kB of archives. After this operation, 53.2 kB disk space will be freed. |
And this is from zypper: install: remove: |
d4d0148
to
1292eed
Compare
I made the above adjustments. And I replaced "incoming" with "inbound" as we have in the API. The resulting output is:
The line |
I was considering whether to use "unpacking" or "operation". Neither is accurate. This is the size after unpacking files from inbound packages and deleting files from outbound (uninstalled/replaced) packages. But the size of the resulting operation may be different - scriptlets will generate/delete additional files (eg. initramfs). |
Although I understand your point about accurateness, I would still prefer |
The class template `OnScopeExit` is a general-purpose scope guard intended to call its exit function when a scope is exited.
Returns `true` if the package is available locally (in cache, command line package).
`format_size` produces partially aligned output with one decimal place. Examples: "25.0 B", "4.0 KiB" Therefore, the function was renamed to `format_size_aligned`. We often need a different format. That's why the function `to_size` was created, which returns a pair of float value and unit. The user can then format the output as desired.
1292eed
to
849204a
Compare
@m-blaha OK. I rebased the PR and changed the message to |
/// The class template OnScopeExit is a general-purpose scope guard | ||
/// intended to call its exit function when a scope is exited. | ||
template <typename TExitFunction> | ||
requires requires(TExitFunction f) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice, that's a first occurrence of C++20 concepts I've seen in our project 🙂
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great, thanks!
Solves issue #342