[pacman-dev] [PATCH 2/3] Only enable total progress when downloads > 1

morganamilo morganamilo at archlinux.org
Sun Apr 18 19:59:44 UTC 2021


Otherwise the total progress will just match the one package and be
pretty useless.
---
 src/pacman/callback.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/pacman/callback.c b/src/pacman/callback.c
index 2b79812e..00360e2c 100644
--- a/src/pacman/callback.c
+++ b/src/pacman/callback.c
@@ -340,7 +340,7 @@ void cb_event(alpm_event_t *event)
 			on_progress = 1;
 			list_total_pkgs = event->pkg_retrieve.num;
 			list_total = event->pkg_retrieve.total_size;
-			total_enabled = list_total;
+			total_enabled = list_total && list_total_pkgs > 1;
 			if(total_enabled) {
 				init_total_progressbar();
 			}
-- 
2.31.1


More information about the pacman-dev mailing list