delta-show: Don't dump whole superblock, do show fallback checksums

Doing `g_variant_print (superblock)` is unreadable and not very useful,
since we show the checksums as byte arrays.

However, do show the checksums for fallback objects. This makes it easier to see
which objects are fallbacks (and inspect why).

Closes: #678
Approved by: giuseppe
This commit is contained in:
Colin Walters 2017-02-10 16:10:20 -05:00 committed by Atomic Bot
parent 98a4547510
commit 0142e5ff39
1 changed files with 5 additions and 5 deletions

View File

@ -884,10 +884,6 @@ _ostree_repo_static_delta_dump (OstreeRepo *self,
OT_VARIANT_MAP_TRUSTED, &delta_superblock, error))
goto out;
{ g_autofree char *variant_string = g_variant_print (delta_superblock, 1);
g_print ("%s\n", variant_string);
}
g_print ("Delta: %s\n", delta_id);
{ const char *endianness_description;
gboolean was_heuristic;
@ -940,9 +936,13 @@ _ostree_repo_static_delta_dump (OstreeRepo *self,
for (i = 0; i < n_fallback; i++)
{
guint64 size, usize;
g_variant_get_child (fallback, i, "(y@aytt)", NULL, NULL, &size, &usize);
g_autoptr(GVariant) checksum_v = NULL;
char checksum[65];
g_variant_get_child (fallback, i, "(y@aytt)", NULL, &checksum_v, &size, &usize);
ostree_checksum_inplace_from_bytes (ostree_checksum_bytes_peek (checksum_v), checksum);
size = maybe_swap_endian_u64 (swap_endian, size);
usize = maybe_swap_endian_u64 (swap_endian, usize);
g_print (" %s\n", checksum);
total_fallback_size += size;
total_fallback_usize += usize;
}