[pacman-dev] [PATCH] Remove redundant transaction size output

Allan McRae allan at archlinux.org
Thu Sep 29 20:42:43 EDT 2011

On 30/09/11 04:25, Dan McGee wrote:
> 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
> ------
> *****
> I'm a crappy packager and write lots of post_install garbage
> *****
> ^^^^^^
> ------

Fair comments.   I think for me at least I did not realize that this 
affected the non-verboselist display as well so did not pay too much 
attention until it showed up on my screen!

I probably did go too sparse on the output.  So how about this:

Download Size -> displayed whenever something is downloaded...  (current 

Package installation only: Installed Size  (current behavior)

Package removal only: Removed Size  (current behavior)

Everything else:
(package upgrade, package installation/upgrade involving replacement, 
combination upgrade and installation)
Installed Size and Net Upgrade Size

So the only change would be not to print Removed Size when both 
Installed Size and Net Upgrade Size are outputted.

i.e.  the entire patch would be:

--- a/src/pacman/util.c
+++ b/src/pacman/util.c
@@ -892,7 +892,7 @@ static void _display_targets(alpm_list_t *targets, 
int verbose)
  			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);


More information about the pacman-dev mailing list