From e428ee47fc08a06d13d09f718e5d564bae7a503d Mon Sep 17 00:00:00 2001 From: Alexander Larsson Date: Fri, 5 May 2017 15:59:33 +0200 Subject: [PATCH] common: Add flatpak_dir_update_remote_configuration_for_summary --- common/flatpak-dir.c | 28 ++++++++++++++++++++-------- common/flatpak-dir.h | 5 +++++ 2 files changed, 25 insertions(+), 8 deletions(-) diff --git a/common/flatpak-dir.c b/common/flatpak-dir.c index d22b730d..ca671416 100644 --- a/common/flatpak-dir.c +++ b/common/flatpak-dir.c @@ -7678,10 +7678,11 @@ flatpak_dir_fetch_remote_summary (FlatpakDir *self, } gboolean -flatpak_dir_update_remote_configuration (FlatpakDir *self, - const char *remote, - GCancellable *cancellable, - GError **error) +flatpak_dir_update_remote_configuration_for_summary (FlatpakDir *self, + const char *remote, + GVariant *summary, + GCancellable *cancellable, + GError **error) { /* We only support those configuration parameters that can be set in the server when building the repo (see the @@ -7691,15 +7692,11 @@ flatpak_dir_update_remote_configuration (FlatpakDir *self, "xa.default-branch", NULL }; - g_autoptr(GVariant) summary = NULL; g_autoptr(GVariant) extensions = NULL; g_autoptr(GPtrArray) updated_params = NULL; GVariantIter iter; updated_params = g_ptr_array_new_with_free_func (g_free); - summary = fetch_remote_summary_file (self, remote, cancellable, error); - if (summary == NULL) - return FALSE; extensions = g_variant_get_child_value (summary, 1); @@ -7798,6 +7795,21 @@ flatpak_dir_update_remote_configuration (FlatpakDir *self, return TRUE; } +gboolean +flatpak_dir_update_remote_configuration (FlatpakDir *self, + const char *remote, + GCancellable *cancellable, + GError **error) +{ + g_autoptr(GVariant) summary = NULL; + + summary = fetch_remote_summary_file (self, remote, cancellable, error); + if (summary == NULL) + return FALSE; + + return flatpak_dir_update_remote_configuration_for_summary (self, remote, summary, cancellable, error); +} + static gboolean flatpak_dir_parse_summary_for_ref (FlatpakDir *self, GVariant *summary, diff --git a/common/flatpak-dir.h b/common/flatpak-dir.h index 5e42691b..78324ad2 100644 --- a/common/flatpak-dir.h +++ b/common/flatpak-dir.h @@ -525,6 +525,11 @@ gboolean flatpak_dir_update_remote_configuration (FlatpakDir *self, const char *remote, GCancellable *cancellable, GError **error); +gboolean flatpak_dir_update_remote_configuration_for_summary (FlatpakDir *self, + const char *remote, + GVariant *summary, + GCancellable *cancellable, + GError **error); gboolean flatpak_dir_fetch_ref_cache (FlatpakDir *self, const char *remote_name, const char *ref,