app/pull-local: Add `--disable-static-delta`
authorJonathan Lebon <jonathan@jlebon.com>
Fri, 8 Sep 2023 19:05:37 +0000 (15:05 -0400)
committerJonathan Lebon <jonathan@jlebon.com>
Fri, 8 Sep 2023 19:07:29 +0000 (15:07 -0400)
For completeness with `pull`.

Prep for using it in testing to assert we'll never use static deltas.

src/ostree/ot-builtin-pull-local.c

index 6ea8da05b7276ef804917f0afba7d3a16f31871a..d489c44bef366612fde38adb5921e81bfb8f1946 100644 (file)
@@ -36,6 +36,7 @@ static gboolean opt_per_object_fsync;
 static gboolean opt_untrusted;
 static gboolean opt_bareuseronly_files;
 static gboolean opt_require_static_deltas;
+static gboolean opt_disable_static_deltas;
 static gboolean opt_gpg_verify;
 static gboolean opt_gpg_verify_summary;
 static gboolean opt_disable_verify_bindings;
@@ -60,6 +61,8 @@ static GOptionEntry options[]
           "Reject regular files with mode outside of 0775 (world writable, suid, etc.)", NULL },
         { "require-static-deltas", 0, 0, G_OPTION_ARG_NONE, &opt_require_static_deltas,
           "Require static deltas", NULL },
+        { "disable-static-deltas", 0, 0, G_OPTION_ARG_NONE, &opt_disable_static_deltas,
+          "Do not use static deltas", NULL },
         { "gpg-verify", 0, 0, G_OPTION_ARG_NONE, &opt_gpg_verify,
           "GPG verify commits (must specify --remote)", NULL },
         { "gpg-verify-summary", 0, 0, G_OPTION_ARG_NONE, &opt_gpg_verify_summary,
@@ -186,6 +189,9 @@ ostree_builtin_pull_local (int argc, char **argv, OstreeCommandInvocation *invoc
     if (opt_remote)
       g_variant_builder_add (&builder, "{s@v}", "override-remote-name",
                              g_variant_new_variant (g_variant_new_string (opt_remote)));
+    g_variant_builder_add (
+        &builder, "{s@v}", "disable-static-deltas",
+        g_variant_new_variant (g_variant_new_boolean (opt_disable_static_deltas)));
     g_variant_builder_add (
         &builder, "{s@v}", "require-static-deltas",
         g_variant_new_variant (g_variant_new_boolean (opt_require_static_deltas)));