From 24bbfffba1ab04450896a70765835bea2893b8d8 Mon Sep 17 00:00:00 2001 From: Juan RP Date: Tue, 25 Feb 2020 08:43:52 +0100 Subject: [PATCH] xbps_transaction_prepare: fix stats for removals. --- lib/transaction_prepare.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/transaction_prepare.c b/lib/transaction_prepare.c index e9cae5f0..6e54d49c 100644 --- a/lib/transaction_prepare.c +++ b/lib/transaction_prepare.c @@ -106,8 +106,11 @@ compute_transaction_stats(struct xbps_handle *xhp) continue; } /* installed_size from repo */ - xbps_dictionary_get_uint64(obj, "installed_size", &tsize); - instsize += tsize; + if (ttype != XBPS_TRANS_REMOVE && ttype != XBPS_TRANS_HOLD && + ttype != XBPS_TRANS_CONFIGURE) { + xbps_dictionary_get_uint64(obj, "installed_size", &tsize); + instsize += tsize; + } /* * If removing or updating a package without preserve, * get installed_size from pkgdb instead.