From 05f918ea93dacb963da171a43b8b166af580abb5 Mon Sep 17 00:00:00 2001 From: Juan RP Date: Mon, 2 Mar 2009 03:06:35 +0100 Subject: [PATCH] xbps-repo: in the show target also print the binpkg file size. Now it looks like: ... Filename: kernel-2.6.28.1.i686.xbps (size: 16M) SHA256: 6b2d79ed89697263020979addde7fa2f535d53df0c1b011ea74ec7757cfba2f0 ... --HG-- extra : convert_revision : 3e18cbc35b8a85fffefe71dd64815ba23c06b528 --- bin/xbps-repo/util.c | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/bin/xbps-repo/util.c b/bin/xbps-repo/util.c index fa337eca625..ec042396156 100644 --- a/bin/xbps-repo/util.c +++ b/bin/xbps-repo/util.c @@ -85,8 +85,21 @@ show_pkg_info(prop_dictionary_t dict) printf("Version: %s\n", prop_string_cstring_nocopy(obj)); obj = prop_dictionary_get(dict, "filename"); - if (obj && prop_object_type(obj) == PROP_TYPE_STRING) - printf("Filename: %s\n", prop_string_cstring_nocopy(obj)); + if (obj && prop_object_type(obj) == PROP_TYPE_STRING) { + printf("Filename: %s", prop_string_cstring_nocopy(obj)); + obj = prop_dictionary_get(dict, "filename-size"); + if (obj && prop_object_type(obj) == PROP_TYPE_NUMBER) { + rv = xbps_humanize_number(size, 5, + (int64_t)prop_number_unsigned_integer_value(obj), + "", HN_AUTOSCALE, HN_NOSPACE); + if (rv == -1) + printf(" (size: %ju)\n", + prop_number_unsigned_integer_value(obj)); + else + printf(" (size: %s)\n", size); + } else + printf("\n"); + } obj = prop_dictionary_get(dict, "filename-sha256"); if (obj && prop_object_type(obj) == PROP_TYPE_STRING)