xbps-bin: printf cosmetics for the install target.
This commit is contained in:
@@ -127,33 +127,34 @@ show_transaction_sizes(struct transaction *trans)
|
|||||||
/*
|
/*
|
||||||
* Show the list of packages that will be installed.
|
* Show the list of packages that will be installed.
|
||||||
*/
|
*/
|
||||||
|
printf("\n");
|
||||||
if (prop_dictionary_get_uint32(trans->d, "total-install-pkgs",
|
if (prop_dictionary_get_uint32(trans->d, "total-install-pkgs",
|
||||||
&trans->inst_pkgcnt)) {
|
&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");
|
trans->inst_pkgcnt, trans->inst_pkgcnt == 1 ? "" : "s");
|
||||||
show_package_list(trans->iter, "install");
|
show_package_list(trans->iter, "install");
|
||||||
printf("\n\n");
|
printf("\n\n");
|
||||||
}
|
}
|
||||||
if (prop_dictionary_get_uint32(trans->d, "total-update-pkgs",
|
if (prop_dictionary_get_uint32(trans->d, "total-update-pkgs",
|
||||||
&trans->up_pkgcnt)) {
|
&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");
|
trans->up_pkgcnt, trans->up_pkgcnt == 1 ? "" : "s");
|
||||||
show_package_list(trans->iter, "update");
|
show_package_list(trans->iter, "update");
|
||||||
printf("\n\n");
|
printf("\n\n");
|
||||||
}
|
}
|
||||||
if (prop_dictionary_get_uint32(trans->d, "total-configure-pkgs",
|
if (prop_dictionary_get_uint32(trans->d, "total-configure-pkgs",
|
||||||
&trans->cf_pkgcnt)) {
|
&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");
|
trans->cf_pkgcnt, trans->cf_pkgcnt == 1 ? "" : "s");
|
||||||
show_package_list(trans->iter, "configure");
|
show_package_list(trans->iter, "configure");
|
||||||
printf("\n\n");
|
printf("\n\n");
|
||||||
}
|
}
|
||||||
if (prop_dictionary_get_uint32(trans->d, "total-remove-pkgs",
|
if (prop_dictionary_get_uint32(trans->d, "total-remove-pkgs",
|
||||||
&trans->rm_pkgcnt)) {
|
&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");
|
trans->rm_pkgcnt, trans->rm_pkgcnt == 1 ? "" : "s");
|
||||||
show_package_list(trans->iter, "remove");
|
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));
|
"%s\n", strerror(errno));
|
||||||
return -1;
|
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) {
|
if (xbps_humanize_number(size, (int64_t)instsize) == -1) {
|
||||||
xbps_error_printf("xbps-bin: error: humanize_number2 returns "
|
xbps_error_printf("xbps-bin: error: humanize_number2 returns "
|
||||||
"%s\n", strerror(errno));
|
"%s\n", strerror(errno));
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
printf("Total installed size:\t%6s\n\n", size);
|
printf("Total installed size:\t%6s\n", size);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user