xbps-bin: some cosmetic informative printfs.

This commit is contained in:
Juan RP 2011-01-30 12:40:16 +01:00
parent 89faf75db4
commit 243685507a
2 changed files with 18 additions and 3 deletions

View File

@ -201,7 +201,7 @@ show_transaction_sizes(struct transaction *trans)
{ {
prop_object_t obj; prop_object_t obj;
uint64_t dlsize = 0, instsize = 0; uint64_t dlsize = 0, instsize = 0;
const char *tract; const char *tract, *p = "s";
char size[8]; char size[8];
bool trans_inst, trans_up, trans_conf; bool trans_inst, trans_up, trans_conf;
@ -252,13 +252,23 @@ show_transaction_sizes(struct transaction *trans)
"%s\n", strerror(errno)); "%s\n", strerror(errno));
return -1; 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) { if (xbps_humanize_number(size, (int64_t)instsize) == -1) {
fprintf(stderr, "xbps-bin: error: humanize_number2 returns " fprintf(stderr, "xbps-bin: error: humanize_number2 returns "
"%s\n", strerror(errno)); "%s\n", strerror(errno));
return -1; 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; return 0;
} }

View File

@ -201,6 +201,11 @@ xbps_remove_installed_pkgs(int argc,
print_package_line(pkgver, false); print_package_line(pkgver, false);
} }
printf("\n\n"); 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?")) { if (!yes && !xbps_noyes("Do you want to continue?")) {
printf("Cancelling!\n"); printf("Cancelling!\n");
prop_object_release(sorted_pkgs); prop_object_release(sorted_pkgs);