Skip to content

Commit 8f01155

Browse files
classabbyampDuncaen
authored andcommitted
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
1 parent 433634f commit 8f01155

File tree

1 file changed

+1
-8
lines changed

1 file changed

+1
-8
lines changed

bin/xbps-install/transaction.c

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -59,19 +59,12 @@ show_actions(xbps_object_iterator_t iter)
5959
isize = dsize = 0;
6060

6161
xbps_dictionary_get_cstring_nocopy(obj, "pkgver", &pkgver);
62-
printf("%s %s", pkgver, ttype2str(obj));
6362
xbps_dictionary_get_cstring_nocopy(obj, "repository", &repoloc);
6463
xbps_dictionary_get_cstring_nocopy(obj, "architecture", &arch);
65-
if (repoloc && arch)
66-
printf(" %s %s", arch, repoloc);
6764
xbps_dictionary_get_uint64(obj, "installed_size", &isize);
6865
xbps_dictionary_get_uint64(obj, "filename-size", &dsize);
69-
if (isize)
70-
printf(" %ju", isize);
71-
if (dsize)
72-
printf(" %ju", dsize);
7366

74-
printf("\n");
67+
printf("%s %s %s %s %ju %ju\n", pkgver, ttype2str(obj), arch ? arch : "-", repoloc ? repoloc : "-", isize, dsize);
7568
}
7669
}
7770

0 commit comments

Comments
 (0)