diff --git a/src/libostree/ostree-repo-pull.c b/src/libostree/ostree-repo-pull.c index 175e3120..19e8d7ed 100644 --- a/src/libostree/ostree-repo-pull.c +++ b/src/libostree/ostree-repo-pull.c @@ -1956,7 +1956,7 @@ ostree_repo_pull_with_options (OstreeRepo *self, } additional_metadata = g_variant_get_child_value (pull_data->summary, 1); - deltas = g_variant_lookup_value (additional_metadata, "ostree.static-deltas", G_VARIANT_TYPE ("a{sv}")); + deltas = g_variant_lookup_value (additional_metadata, OSTREE_SUMMARY_STATIC_DELTAS, G_VARIANT_TYPE ("a{sv}")); n = deltas ? g_variant_n_children (deltas) : 0; for (i = 0; i < n; i++) { diff --git a/src/libostree/ostree-repo-static-delta-private.h b/src/libostree/ostree-repo-static-delta-private.h index 0cf2a0bd..4df3b8c6 100644 --- a/src/libostree/ostree-repo-static-delta-private.h +++ b/src/libostree/ostree-repo-static-delta-private.h @@ -29,6 +29,8 @@ G_BEGIN_DECLS /* 1 byte for object type, 32 bytes for checksum */ #define OSTREE_STATIC_DELTA_OBJTYPE_CSUM_LEN 33 +#define OSTREE_SUMMARY_STATIC_DELTAS "ostree.static-deltas" + /** * OSTREE_STATIC_DELTA_PART_PAYLOAD_FORMAT_V0: * diff --git a/src/libostree/ostree-repo.c b/src/libostree/ostree-repo.c index d823725d..0d4f4e2e 100644 --- a/src/libostree/ostree-repo.c +++ b/src/libostree/ostree-repo.c @@ -33,6 +33,7 @@ #include "ostree-repo-file.h" #include "ostree-repo-file-enumerator.h" #include "ostree-gpg-verifier.h" +#include "ostree-repo-static-delta-private.h" #include #include @@ -3668,7 +3669,7 @@ ostree_repo_regenerate_summary (OstreeRepo *self, g_variant_dict_insert_value (&deltas_builder, delta_names->pdata[i], ot_gvariant_new_bytearray (csum, 32)); } - g_variant_dict_insert_value (&additional_metadata_builder, "ostree.static-deltas", g_variant_dict_end (&deltas_builder)); + g_variant_dict_insert_value (&additional_metadata_builder, OSTREE_SUMMARY_STATIC_DELTAS, g_variant_dict_end (&deltas_builder)); } { diff --git a/src/ostree/ot-builtin-pull.c b/src/ostree/ot-builtin-pull.c index 424ba412..874e6dae 100644 --- a/src/ostree/ot-builtin-pull.c +++ b/src/ostree/ot-builtin-pull.c @@ -29,11 +29,13 @@ static gboolean opt_disable_fsync; static gboolean opt_mirror; +static gboolean opt_disable_static_deltas; static char* opt_subpath; static int opt_depth = 0; static GOptionEntry options[] = { { "disable-fsync", 0, 0, G_OPTION_ARG_NONE, &opt_disable_fsync, "Do not invoke fsync()", NULL }, + { "disable-static-deltas", 0, 0, G_OPTION_ARG_NONE, &opt_disable_static_deltas, "Do not use static deltas", NULL }, { "mirror", 0, 0, G_OPTION_ARG_NONE, &opt_mirror, "Write refs suitable for a mirror", NULL }, { "subpath", 0, 0, G_OPTION_ARG_STRING, &opt_subpath, "Only pull the provided subpath", NULL }, { "depth", 0, 0, G_OPTION_ARG_INT, &opt_depth, "Traverse DEPTH parents (-1=infinite) (default: 0)", "DEPTH" }, @@ -135,6 +137,9 @@ ostree_builtin_pull (int argc, char **argv, GCancellable *cancellable, GError ** g_variant_builder_add (&builder, "{s@v}", "depth", g_variant_new_variant (g_variant_new_int32 (opt_depth))); + g_variant_builder_add (&builder, "{s@v}", "disable-static-deltas", + g_variant_new_variant (g_variant_new_boolean (opt_disable_static_deltas))); + if (!ostree_repo_pull_with_options (repo, remote, g_variant_builder_end (&builder), progress, cancellable, error)) goto out;