From bb3a0e3fa4a3569882b8e4ad9aceae5271bd0c63 Mon Sep 17 00:00:00 2001 From: Georges Basile Stavracas Neto Date: Wed, 8 Mar 2017 14:19:29 -0300 Subject: [PATCH] ostree: allow setting update frequency from command line After commit 80b3edc64731a5f0 introducing the option to set a custom timeout, adapt the ostree program to be able to update that. Closes: #725 Approved by: jlebon --- src/ostree/ot-builtin-pull.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/ostree/ot-builtin-pull.c b/src/ostree/ot-builtin-pull.c index 170a3a91..4287afcd 100644 --- a/src/ostree/ot-builtin-pull.c +++ b/src/ostree/ot-builtin-pull.c @@ -38,6 +38,7 @@ static char** opt_subpaths; static char** opt_http_headers; static char* opt_cache_dir; static int opt_depth = 0; +static int opt_frequency = 0; static char* opt_url; static GOptionEntry options[] = { @@ -53,6 +54,7 @@ static GOptionEntry options[] = { { "depth", 0, 0, G_OPTION_ARG_INT, &opt_depth, "Traverse DEPTH parents (-1=infinite) (default: 0)", "DEPTH" }, { "url", 0, 0, G_OPTION_ARG_STRING, &opt_url, "Pull objects from this URL instead of the one from the remote config", NULL }, { "http-header", 0, 0, G_OPTION_ARG_STRING_ARRAY, &opt_http_headers, "Add NAME=VALUE as HTTP header to all requests", "NAME=VALUE" }, + { "update-frequency", 0, 0, G_OPTION_ARG_INT, &opt_frequency, "Sets the update frequency, in milliseconds (0=1000ms) (default: 0)", "FREQUENCY" }, { NULL } }; @@ -252,6 +254,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}", "update-frequency", + g_variant_new_variant (g_variant_new_uint32 (opt_frequency))); + g_variant_builder_add (&builder, "{s@v}", "disable-static-deltas", g_variant_new_variant (g_variant_new_boolean (opt_disable_static_deltas)));