From da75866a633ef9fa069c8261fe076dbea6961e7c Mon Sep 17 00:00:00 2001 From: Juan RP Date: Fri, 1 Jun 2012 11:28:30 +0200 Subject: [PATCH] xbps-bin: -n now also prints pkg arch. --- NEWS | 3 +++ bin/xbps-bin/transaction.c | 15 ++++++++------- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/NEWS b/NEWS index eb2b6c89..3f1ad3ca 100644 --- a/NEWS +++ b/NEWS @@ -1,5 +1,8 @@ xbps-0.16 (???): + * xbps-bin(8): -n flag (dry-run mode) now also prints the pkg architecture + as last component and if the transaction reason supports it. + * Repository index format 1.5. The files are now named properly: index.plist for XBPS_PKGINDEX and index-files.plist for XBPS_PKGINDEX_FILES. The difference in XBPS_PKGINDEX is that now a single plist file can store diff --git a/bin/xbps-bin/transaction.c b/bin/xbps-bin/transaction.c index 2eda866d..77646aa6 100644 --- a/bin/xbps-bin/transaction.c +++ b/bin/xbps-bin/transaction.c @@ -67,19 +67,20 @@ static void show_actions(prop_object_iterator_t iter) { prop_object_t obj; - const char *repoloc, *trans, *pkgname, *version, *fname; + const char *repoloc, *trans, *pkgname, *version, *fname, *arch; + + repoloc = trans = pkgname = version = fname = arch = NULL; while ((obj = prop_object_iterator_next(iter)) != NULL) { prop_dictionary_get_cstring_nocopy(obj, "transaction", &trans); prop_dictionary_get_cstring_nocopy(obj, "pkgname", &pkgname); prop_dictionary_get_cstring_nocopy(obj, "version", &version); printf("%s %s %s", pkgname, trans, version); - if (prop_dictionary_get_cstring_nocopy(obj, - "repository", &repoloc)) - printf(" %s ", repoloc); - if (prop_dictionary_get_cstring_nocopy(obj, - "filename", &fname)) - printf("%s", fname); + prop_dictionary_get_cstring_nocopy(obj, "repository", &repoloc); + prop_dictionary_get_cstring_nocopy(obj, "filename", &fname); + prop_dictionary_get_cstring_nocopy(obj, "architecture", &arch); + if (repoloc && fname && arch) + printf(" %s %s %s", repoloc, fname, arch); printf("\n"); }