xbps_show_pkg_info(): use humanize_number().
--HG-- extra : convert_revision : e1c903e76d6d5b6501c8893b6d14e23e5b395e58
This commit is contained in:
parent
1105f4f278
commit
d10d9e824c
4 changed files with 54 additions and 9 deletions
10
lib/plist.c
10
lib/plist.c
|
@ -373,6 +373,7 @@ xbps_show_pkg_info(prop_dictionary_t dict)
|
|||
{
|
||||
prop_object_t obj;
|
||||
const char *sep = NULL;
|
||||
char size[64];
|
||||
|
||||
assert(dict != NULL);
|
||||
if (prop_dictionary_count(dict) == 0)
|
||||
|
@ -383,9 +384,12 @@ xbps_show_pkg_info(prop_dictionary_t dict)
|
|||
printf("Package: %s\n", prop_string_cstring_nocopy(obj));
|
||||
|
||||
obj = prop_dictionary_get(dict, "installed_size");
|
||||
if (obj && prop_object_type(obj) == PROP_TYPE_NUMBER)
|
||||
printf("Installed size: %zu bytes\n",
|
||||
prop_number_unsigned_integer_value(obj));
|
||||
if (obj && prop_object_type(obj) == PROP_TYPE_NUMBER) {
|
||||
humanize_number(size, 5,
|
||||
(int64_t)prop_number_unsigned_integer_value(obj),
|
||||
"", HN_AUTOSCALE, HN_B | HN_NOSPACE | HN_DECIMAL);
|
||||
printf("Installed size: %s\n", size);
|
||||
}
|
||||
|
||||
obj = prop_dictionary_get(dict, "maintainer");
|
||||
if (obj && prop_object_type(obj) == PROP_TYPE_STRING)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue