From 243685507a1433f965c1ffeefb79e0b62b12e911 Mon Sep 17 00:00:00 2001 From: Juan RP Date: Sun, 30 Jan 2011 12:40:16 +0100 Subject: [PATCH] xbps-bin: some cosmetic informative printfs. --- bin/xbps-bin/install.c | 16 +++++++++++++--- bin/xbps-bin/remove.c | 5 +++++ 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/bin/xbps-bin/install.c b/bin/xbps-bin/install.c index 07946427..ad655875 100644 --- a/bin/xbps-bin/install.c +++ b/bin/xbps-bin/install.c @@ -201,7 +201,7 @@ show_transaction_sizes(struct transaction *trans) { prop_object_t obj; uint64_t dlsize = 0, instsize = 0; - const char *tract; + const char *tract, *p = "s"; char size[8]; bool trans_inst, trans_up, trans_conf; @@ -252,13 +252,23 @@ show_transaction_sizes(struct transaction *trans) "%s\n", strerror(errno)); return -1; } - printf("Total download size: %s\n", size); + printf("Total download size:\t%6s\n", size); if (xbps_humanize_number(size, (int64_t)instsize) == -1) { fprintf(stderr, "xbps-bin: error: humanize_number2 returns " "%s\n", strerror(errno)); return -1; } - printf("Total installed size: %s\n\n", size); + printf("Total installed size:\t%6s\n\n", size); + + if (trans->inst_pkgcnt == 1) + p = ""; + printf("%6zu package%s will be installed.\n", trans->inst_pkgcnt, p); + if (trans->up_pkgcnt == 1) + p = ""; + printf("%6zu package%s will be updated.\n", trans->up_pkgcnt, p); + if (trans->cf_pkgcnt == 1) + p = ""; + printf("%6zu package%s will be configured.\n\n", trans->cf_pkgcnt, p); return 0; } diff --git a/bin/xbps-bin/remove.c b/bin/xbps-bin/remove.c index 48c4ab05..2bc7f54b 100644 --- a/bin/xbps-bin/remove.c +++ b/bin/xbps-bin/remove.c @@ -201,6 +201,11 @@ xbps_remove_installed_pkgs(int argc, print_package_line(pkgver, false); } printf("\n\n"); + printf("%u package%s will be removed%s.\n\n", + prop_array_count(sorted_pkgs), + prop_array_count(sorted_pkgs) == 1 ? "" : "s", + purge ? " and purged" : ""); + if (!yes && !xbps_noyes("Do you want to continue?")) { printf("Cancelling!\n"); prop_object_release(sorted_pkgs);