On 29/09/11 21:18, Allan McRae 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
Signed-off-by: Allan McRae<allan@archlinux.org> ---
Perhaps all that extra output could still be printed in verbosepkglist mode? My intention was to reduce the output for the non-verbose mode as it was becoming too... well verbose. That would be easy to implement. Thoughts? A blue coloured bikeshed?
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); }