From: Colin Walters Date: Fri, 10 Feb 2017 21:10:20 +0000 (-0500) Subject: delta-show: Don't dump whole superblock, do show fallback checksums X-Git-Tag: archive/raspbian/2022.1-3+rpi1~1^2~4^2~40^2~34 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=0142e5ff393d4fc9e781d22cfea2e68a95a69dae;p=ostree.git 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 --- 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; }