From 4435df18886058a6300c56b145cfa530b8182af0 Mon Sep 17 00:00:00 2001 From: classabbyamp Date: Tue, 10 Dec 2024 17:08:48 -0500 Subject: [PATCH] bin/xbps-install/transaction: print consistently for dry run this ensures there will always be 6 fields per line, making it possible to parse the output consistently. `arch` and `repository` default to `-`. `installed_size` and `filename-size` default to `0` to allow for easy tabulation. Fixes: #610 --- bin/xbps-install/transaction.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/bin/xbps-install/transaction.c b/bin/xbps-install/transaction.c index 1e207741d..bff70b189 100644 --- a/bin/xbps-install/transaction.c +++ b/bin/xbps-install/transaction.c @@ -59,19 +59,12 @@ show_actions(xbps_object_iterator_t iter) isize = dsize = 0; xbps_dictionary_get_cstring_nocopy(obj, "pkgver", &pkgver); - printf("%s %s", pkgver, ttype2str(obj)); xbps_dictionary_get_cstring_nocopy(obj, "repository", &repoloc); xbps_dictionary_get_cstring_nocopy(obj, "architecture", &arch); - if (repoloc && arch) - printf(" %s %s", arch, repoloc); xbps_dictionary_get_uint64(obj, "installed_size", &isize); xbps_dictionary_get_uint64(obj, "filename-size", &dsize); - if (isize) - printf(" %ju", isize); - if (dsize) - printf(" %ju", dsize); - printf("\n"); + printf("%s %s %s %s %ju %ju\n", pkgver, ttype2str(obj), arch ? arch : "-", repoloc ? repoloc : "-", isize, dsize); } }