xbps-bin: printf cosmetics for the install target.

This commit is contained in:
Juan RP 2011-10-18 21:40:26 +02:00
parent 931a03b806
commit 8fa21753b1

View File

@ -127,33 +127,34 @@ show_transaction_sizes(struct transaction *trans)
/*
* Show the list of packages that will be installed.
*/
printf("\n");
if (prop_dictionary_get_uint32(trans->d, "total-install-pkgs",
&trans->inst_pkgcnt)) {
printf("%u package%s will be installed:\n\n",
printf("%u package%s will be installed:\n",
trans->inst_pkgcnt, trans->inst_pkgcnt == 1 ? "" : "s");
show_package_list(trans->iter, "install");
printf("\n\n");
}
if (prop_dictionary_get_uint32(trans->d, "total-update-pkgs",
&trans->up_pkgcnt)) {
printf("%u package%s will be updated:\n\n",
printf("%u package%s will be updated:\n",
trans->up_pkgcnt, trans->up_pkgcnt == 1 ? "" : "s");
show_package_list(trans->iter, "update");
printf("\n\n");
}
if (prop_dictionary_get_uint32(trans->d, "total-configure-pkgs",
&trans->cf_pkgcnt)) {
printf("%u package%s will be configured:\n\n",
printf("%u package%s will be configured:\n",
trans->cf_pkgcnt, trans->cf_pkgcnt == 1 ? "" : "s");
show_package_list(trans->iter, "configure");
printf("\n\n");
}
if (prop_dictionary_get_uint32(trans->d, "total-remove-pkgs",
&trans->rm_pkgcnt)) {
printf("%u package%s will be removed:\n\n",
printf("%u package%s will be removed:\n",
trans->rm_pkgcnt, trans->rm_pkgcnt == 1 ? "" : "s");
show_package_list(trans->iter, "remove");
printf("\n\n");
printf("\n");
}
/*
@ -167,13 +168,13 @@ show_transaction_sizes(struct transaction *trans)
"%s\n", strerror(errno));
return -1;
}
printf("Total download size:\t%6s\n", size);
printf("\nTotal download size:\t%6s\n", size);
if (xbps_humanize_number(size, (int64_t)instsize) == -1) {
xbps_error_printf("xbps-bin: error: humanize_number2 returns "
"%s\n", strerror(errno));
return -1;
}
printf("Total installed size:\t%6s\n\n", size);
printf("Total installed size:\t%6s\n", size);
return 0;
}