lib: Minor static delta fixes
authorColin Walters <walters@verbum.org>
Fri, 27 Oct 2017 20:14:02 +0000 (16:14 -0400)
committerAtomic Bot <atomic-devel@projectatomic.io>
Mon, 30 Oct 2017 22:52:02 +0000 (22:52 +0000)
First, the manual crosscheck script bitrotted; it got caught up
in the "use libtest repo creation wrapper" bit, and also it
seems like at some point `pull --require-static-deltas` changed
meaning when dealing with `file:///` repos.  I have more work to
unwind that.

Next, I'm seeing a delta failure which looks like a static delta
miscompilation with rollsums; change the compiler to print out
the source object too, which helped me debug this.

And finally in the processing code, fix incorrect error prefixing, which was
misleading.

Closes: #1311
Approved by: ashcrow

manual-tests/static-delta-generate-crosscheck.sh
src/libostree/ostree-repo-static-delta-compilation.c
src/libostree/ostree-repo-static-delta-processing.c

index fd8f218957f23ac26ee4755ddb6e188c87293c9e..2eea3ff25f7f963ec7bd9f3efaaf6fe8944890f9 100755 (executable)
@@ -42,11 +42,11 @@ assert_streq() {
 }
 
 validate_delta_options() {
-    mkdir testrepo
-    ostree_repo_init testrepo --mode=bare-user
+    ostree --repo=testrepo init --mode=bare-user
     ostree --repo=testrepo remote add --set=gpg-verify=false local file://${repo}
     ostree --repo=${repo} static-delta generate $@ --from=${from} --to=${to}
-    ostree --repo=testrepo pull --require-static-deltas local ${branch}@${from}
+    ostree --repo=${repo} summary -u
+    ostree --repo=testrepo pull local ${branch}@${from}
     assert_streq $(ostree --repo=testrepo rev-parse ${branch}) ${from}
     ostree --repo=testrepo pull --require-static-deltas local ${branch}
     assert_streq $(ostree --repo=testrepo rev-parse ${branch}) ${to}
index 41cd347eadaf3b50ce901b81c522b9e55e9c313c..19272984100d87f967f7133edfc23732407be591 100644 (file)
@@ -651,8 +651,8 @@ try_content_rollsum (OstreeRepo                       *repo,
 
   if (opts & DELTAOPT_FLAG_VERBOSE)
     {
-      g_printerr ("rollsum for %s; crcs=%u bufs=%u total=%u matchsize=%llu\n",
-                  to, matches->crcmatches,
+      g_printerr ("rollsum for %s -> %s; crcs=%u bufs=%u total=%u matchsize=%llu\n",
+                  from, to, matches->crcmatches,
                   matches->bufmatches,
                   matches->total, (unsigned long long)matches->match_size);
     }
index 87b5c8c988bd22c6f4a60b0a4aa9836acee3e1fe..4545b39f90ea7c347585cd66fed46ac7a26490bd 100644 (file)
@@ -711,7 +711,7 @@ dispatch_write (OstreeRepo                 *repo,
                GCancellable               *cancellable,
                GError                    **error)
 {
-  GLNX_AUTO_PREFIX_ERROR("opcode open-splice-and-close", error);
+  GLNX_AUTO_PREFIX_ERROR("opcode write", error);
   guint64 content_size;
   guint64 content_offset;
 
@@ -816,7 +816,7 @@ dispatch_close (OstreeRepo                 *repo,
                 GCancellable               *cancellable,
                 GError                    **error)
 {
-  GLNX_AUTO_PREFIX_ERROR("opcode open-splice-and-close", error);
+  GLNX_AUTO_PREFIX_ERROR("opcode close", error);
 
   if (state->content_out)
     {