From 13172c22fcbc5dd4057ba4a73e7627fb08699748 Mon Sep 17 00:00:00 2001 From: Juan RP Date: Fri, 21 Jun 2019 16:26:08 +0200 Subject: [PATCH] xbps-install: only print num of downloaded pkgs with -D. --- bin/xbps-install/transaction.c | 19 +++++++++---------- bin/xbps-install/util.c | 6 ++++++ 2 files changed, 15 insertions(+), 10 deletions(-) diff --git a/bin/xbps-install/transaction.c b/bin/xbps-install/transaction.c index 3af96154..cdcc92d7 100644 --- a/bin/xbps-install/transaction.c +++ b/bin/xbps-install/transaction.c @@ -125,16 +125,6 @@ show_transaction_sizes(struct transaction *trans, int cols) uint64_t dlsize = 0, instsize = 0, rmsize = 0, disk_free_size = 0; char size[8]; - if (trans->xhp->flags & XBPS_FLAG_DOWNLOAD_ONLY) { - xbps_dictionary_get_uint32(trans->d, "total-download-pkgs", - &trans->dl_pkgcnt); - trans->inst_pkgcnt = 0; - trans->up_pkgcnt = 0; - trans->cf_pkgcnt = 0; - trans->rm_pkgcnt = 0; - goto out; - } - if (!print_trans_colmode(trans, cols)) { /* * Show the list of packages that will be downloaded, installed, updated, @@ -148,6 +138,14 @@ show_transaction_sizes(struct transaction *trans, int cols) show_package_list(trans, NULL, cols); printf("\n"); } + if (trans->xhp->flags & XBPS_FLAG_DOWNLOAD_ONLY) { + trans->inst_pkgcnt = 0; + trans->up_pkgcnt = 0; + trans->cf_pkgcnt = 0; + trans->rm_pkgcnt = 0; + goto out; + } + xbps_dictionary_get_uint32(trans->d, "total-install-pkgs", &trans->inst_pkgcnt); if (trans->inst_pkgcnt) { @@ -189,6 +187,7 @@ out: xbps_dictionary_get_uint64(trans->d, "total-installed-size", &instsize); xbps_dictionary_get_uint64(trans->d, "total-removed-size", &rmsize); xbps_dictionary_get_uint64(trans->d, "disk-free-size", &disk_free_size); + if (dlsize || instsize || rmsize || disk_free_size) printf("\n"); diff --git a/bin/xbps-install/util.c b/bin/xbps-install/util.c index eff9f4ac..84753edb 100644 --- a/bin/xbps-install/util.c +++ b/bin/xbps-install/util.c @@ -147,6 +147,12 @@ print_trans_colmode(struct transaction *trans, int cols) } else if (strcmp(tract, "configure") == 0) { trans->cf_pkgcnt++; } + if (trans->xhp->flags & XBPS_FLAG_DOWNLOAD_ONLY) { + trans->inst_pkgcnt = 0; + trans->up_pkgcnt = 0; + trans->rm_pkgcnt = 0; + trans->cf_pkgcnt = 0; + } if (dload) { trans->dl_pkgcnt++; }