From aec1191fa951c07a6cd7986d027b1fce3fb0703b Mon Sep 17 00:00:00 2001 From: Colin Walters Date: Mon, 30 Oct 2017 11:04:46 -0400 Subject: [PATCH] deltas: Add an if0'd bit to print bsdiff objects I used this to find the bsdiff'd objects. Closes: #1314 Approved by: jlebon --- .../ostree-repo-static-delta-compilation.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/libostree/ostree-repo-static-delta-compilation.c b/src/libostree/ostree-repo-static-delta-compilation.c index 93a191a0..2dc61718 100644 --- a/src/libostree/ostree-repo-static-delta-compilation.c +++ b/src/libostree/ostree-repo-static-delta-compilation.c @@ -906,6 +906,20 @@ process_one_bsdiff (OstreeRepo *repo, _ostree_write_varuint64 (current_part->operations, current_part->payload->len); _ostree_write_varuint64 (current_part->operations, payload_size); + /* A bit too verbose to print by default...but leaving this #if 0'd out to + * use later. One approach I've been thinking about is to optionally + * output e.g. a JSON file as we build the deltas. Alternatively, we could + * try to reverse engineer things more in the "show" path, but that gets + * hard/messy as it's quite optimized for execution now. + */ +#if 0 + g_printerr ("bspatch %s [%llu] → %s [%llu] bsdiff:%llu (%f)\n", + bsdiff_content->from_checksum, (unsigned long long)tmp_from_len, + to_checksum, (unsigned long long)tmp_to_len, + (unsigned long long)payload_size, + ((double)payload_size)/tmp_to_len); +#endif + g_string_append_len (current_part->payload, payload, payload_size); } g_string_append_c (current_part->operations, (gchar)OSTREE_STATIC_DELTA_OP_CLOSE);