diff options
author | Alexander Larsson <alexl@redhat.com> | 2018-04-13 16:21:19 +0200 |
---|---|---|
committer | Atomic Bot <atomic-devel@projectatomic.io> | 2018-04-16 15:44:06 +0000 |
commit | 0e5baf3837589328dd6eba23e3b1caf921c690d1 (patch) | |
tree | e606ccad14484e5de62a6113acf0563b64750f08 /common/flatpak-dir.c | |
parent | 48796fb29d7d8af3799457a9c10cafd91ce01513 (diff) | |
download | flatpak-0e5baf3837589328dd6eba23e3b1caf921c690d1.tar.gz |
dir: Remove unused functions
flatpak_dir_get_remote_metadata and flatpak_dir_lookup_repo_metadata are now
not used anymore.
Closes: #1575
Approved by: alexlarsson
Diffstat (limited to 'common/flatpak-dir.c')
-rw-r--r-- | common/flatpak-dir.c | 91 |
1 files changed, 0 insertions, 91 deletions
diff --git a/common/flatpak-dir.c b/common/flatpak-dir.c index 17a1fd82..e2cc6830 100644 --- a/common/flatpak-dir.c +++ b/common/flatpak-dir.c @@ -3237,97 +3237,6 @@ oci_pull_progress_cb (guint64 total_size, guint64 pulled_size, NULL); } -/* Look up a piece of per-repository metadata. Previously, this was stored in - * the summary file; now it’s stored the commit metadata of a special branch. - * Differentiate based on whether the collection ID is set for the remote. - * Returns %FALSE on error or if @key doesn’t exist (in which case, no error is - * set). */ -static GVariant * -flatpak_dir_get_remote_metadata (FlatpakDir *self, - const char *remote_name, - GCancellable *cancellable, - GError **error) -{ - g_autoptr(GVariant) metadata = NULL; - g_autofree char *collection_id = NULL; - g_autoptr(GVariant) summary_v = NULL; - - if (!flatpak_dir_ensure_repo (self, cancellable, error)) - return NULL; - - if (!repo_get_remote_collection_id (self->repo, remote_name, &collection_id, error)) - return NULL; - - summary_v = fetch_remote_summary_file (self, remote_name, NULL, cancellable, error); - if (summary_v == NULL) - return NULL; - - if (collection_id == NULL) - { - - metadata = g_variant_get_child_value (summary_v, 1); - } - else - { -#ifdef FLATPAK_ENABLE_P2P - g_autofree char *latest_rev = NULL; - g_autoptr(GVariant) commit_v = NULL; - - /* Make sure the branch is up to date. */ - if (!flatpak_dir_fetch_remote_repo_metadata (self, remote_name, summary_v, collection_id, cancellable, error)) - return NULL; - - /* Look up the commit containing the latest repository metadata. */ - latest_rev = flatpak_dir_read_latest (self, remote_name, OSTREE_REPO_METADATA_REF, - NULL, cancellable, error); - if (latest_rev == NULL) - return NULL; - - if (!ostree_repo_load_commit (self->repo, latest_rev, &commit_v, NULL, error)) - return NULL; - - metadata = g_variant_get_child_value (commit_v, 0); -#else /* if !FLATPAK_ENABLE_P2P */ - g_assert_not_reached (); -#endif /* !FLATPAK_ENABLE_P2P */ - } - - return g_steal_pointer (&metadata); -} - -gboolean -flatpak_dir_lookup_repo_metadata (FlatpakDir *self, - const char *remote_name, - GCancellable *cancellable, - GError **error, - const char *key, - const char *format_string, - ...) -{ - g_autoptr(GVariant) metadata = NULL; - g_autoptr(GVariant) value = NULL; - va_list args; - - metadata = flatpak_dir_get_remote_metadata (self, remote_name, - cancellable, error); - if (metadata == NULL) - return FALSE; - - /* Extract the metadata from it, if set. */ - value = g_variant_lookup_value (metadata, key, NULL); - if (value == NULL) - return FALSE; - - if (!g_variant_check_format_string (value, format_string, FALSE)) - return FALSE; - - va_start (args, format_string); - g_variant_get_va (value, format_string, NULL, &args); - va_end (args); - - return TRUE; -} - static gboolean flatpak_dir_mirror_oci (FlatpakDir *self, FlatpakOciRegistry *dst_registry, |