Skip to content

Commit

Permalink
bin/xbps-install/transaction: print consistently for dry run
Browse files Browse the repository at this point in the history
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
  • Loading branch information
classabbyamp authored and Duncaen committed Jan 21, 2025
1 parent 433634f commit 8f01155
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions bin/xbps-install/transaction.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}

Expand Down

0 comments on commit 8f01155

Please sign in to comment.