[pacman-dev] [PATCH] Remove redundant transaction size output
Dan McGee
dpmcgee at gmail.com
Thu Sep 29 14:25:36 EDT 2011
On Thu, Sep 29, 2011 at 6:18 AM, Allan McRae <allan at archlinux.org> wrote:
> Printing all of "Installed", "Removed" and "Net Upgrade" sizes is
> redundant as the difference of the first two is the last. Instead,
> only print "Net Upgrade Size" when both the installed and removed
> are non-zero.
>
> This results in the following output in the following cases:
> - package installation only: Installed Size
> - package installation involving replacement: Net Upgrade Size
> - package removal only: Removed Size
> - package upgrade: Net Upgrade Size
> - combination upgrade and installation: Net Upgrade Size
Point 4 in my original email of this patch series
(http://mailman.archlinux.org/pipermail/pacman-dev/2011-July/013905.html):
* Yes, you get 4 different totals now on -S operations, but since the damn
package list is so long anyway, who cares.
So apparently no one read that, or more likely, it wasn't clear this
affected the old-style display as well.
Here is the problem as I see it- we used to show Installed Size, which
was a good judge of how "big" the upgrade was. People really wanted
net upgrade size and I implemented that, but didn't remove installed
size as neither download size (which can be 0.00 MiB if you already
have all the packages) nor net upgrade size really show the breadth of
the update.
In simple terms: 10 - 9 = 1, but so does 1000 - 999. (install - remove
= net if you didn't pick up on that.)
So I'm mixed here. I agree we are taking up some real estate with
these messages, but is it that big of deal? Think of all the progress
bars that come after, not to mention
NOTE
------
*****
I'm a crappy packager and write lots of post_install garbage
*****
^^^^^^
------
END STUPID NOTE
>
> Signed-off-by: Allan McRae <allan at archlinux.org>
> ---
> src/pacman/util.c | 4 ++--
> 1 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/src/pacman/util.c b/src/pacman/util.c
> index 34cdc8c..65bd8d3 100644
> --- a/src/pacman/util.c
> +++ b/src/pacman/util.c
> @@ -881,11 +881,11 @@ static void _display_targets(alpm_list_t *targets)
> printf(_("Total Download Size: %.2f %s\n"), size, label);
> }
> if(!config->op_s_downloadonly) {
> - if(isize > 0) {
> + if(isize > 0 && rsize == 0) {
> size = humanize_size(isize, 'M', &label);
> printf(_("Total Installed Size: %.2f %s\n"), size, label);
> }
> - if(rsize > 0) {
> + if(rsize > 0 && isize == 0) {
> size = humanize_size(rsize, 'M', &label);
> printf(_("Total Removed Size: %.2f %s\n"), size, label);
> }
> --
> 1.7.6.4
>
>
>
More information about the pacman-dev
mailing list