xbps-bin: -n now also prints pkg arch.

This commit is contained in:
Juan RP 2012-06-01 11:28:30 +02:00
parent 0b078cf400
commit da75866a63
2 changed files with 11 additions and 7 deletions

3
NEWS
View File

@ -1,5 +1,8 @@
xbps-0.16 (???): 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: * Repository index format 1.5. The files are now named properly:
index.plist for XBPS_PKGINDEX and index-files.plist for XBPS_PKGINDEX_FILES. 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 The difference in XBPS_PKGINDEX is that now a single plist file can store

View File

@ -67,19 +67,20 @@ static void
show_actions(prop_object_iterator_t iter) show_actions(prop_object_iterator_t iter)
{ {
prop_object_t obj; 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) { while ((obj = prop_object_iterator_next(iter)) != NULL) {
prop_dictionary_get_cstring_nocopy(obj, "transaction", &trans); prop_dictionary_get_cstring_nocopy(obj, "transaction", &trans);
prop_dictionary_get_cstring_nocopy(obj, "pkgname", &pkgname); prop_dictionary_get_cstring_nocopy(obj, "pkgname", &pkgname);
prop_dictionary_get_cstring_nocopy(obj, "version", &version); prop_dictionary_get_cstring_nocopy(obj, "version", &version);
printf("%s %s %s", pkgname, trans, version); printf("%s %s %s", pkgname, trans, version);
if (prop_dictionary_get_cstring_nocopy(obj, prop_dictionary_get_cstring_nocopy(obj, "repository", &repoloc);
"repository", &repoloc)) prop_dictionary_get_cstring_nocopy(obj, "filename", &fname);
printf(" %s ", repoloc); prop_dictionary_get_cstring_nocopy(obj, "architecture", &arch);
if (prop_dictionary_get_cstring_nocopy(obj, if (repoloc && fname && arch)
"filename", &fname)) printf(" %s %s %s", repoloc, fname, arch);
printf("%s", fname);
printf("\n"); printf("\n");
} }