From 0142e5ff393d4fc9e781d22cfea2e68a95a69dae Mon Sep 17 00:00:00 2001 From: Colin Walters Date: Fri, 10 Feb 2017 16:10:20 -0500 Subject: [PATCH] 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 --- src/libostree/ostree-repo-static-delta-core.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/libostree/ostree-repo-static-delta-core.c b/src/libostree/ostree-repo-static-delta-core.c index edbf965b..1ab11ed7 100644 --- a/src/libostree/ostree-repo-static-delta-core.c +++ b/src/libostree/ostree-repo-static-delta-core.c @@ -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; }