diff options
author | Alexander Larsson <alexl@redhat.com> | 2016-04-14 20:04:51 +0200 |
---|---|---|
committer | Alexander Larsson <alexl@redhat.com> | 2016-04-14 20:04:51 +0200 |
commit | 167564b63743313677bbb2d85b3941791094f75e (patch) | |
tree | 09d1e75a7ad5a7798090a78e15d1cd81974c69e3 /common | |
parent | fe1004f6af4f923576f194c6f1be5306b9ee9b84 (diff) | |
download | xdg-app-167564b63743313677bbb2d85b3941791094f75e.tar.gz |
common: Add xdg_app_dir_remote_fetch_summary
This is in preparation for adding a cache for the summary
Diffstat (limited to 'common')
-rw-r--r-- | common/xdg-app-dir.c | 29 |
1 files changed, 23 insertions, 6 deletions
diff --git a/common/xdg-app-dir.c b/common/xdg-app-dir.c index 051f9a7..2c70497 100644 --- a/common/xdg-app-dir.c +++ b/common/xdg-app-dir.c @@ -2749,6 +2749,23 @@ xdg_app_dir_get_if_deployed (XdgAppDir *self, return NULL; } +static gboolean +xdg_app_dir_remote_fetch_summary (XdgAppDir *self, + const char *name, + GBytes **out_summary, + GCancellable *cancellable, + GError **error) +{ + /* TODO: Add in-memory cache here, also use for ostree_repo_list_refs */ + if (!ostree_repo_remote_fetch_summary (self->repo, name, + out_summary, NULL, + cancellable, + error)) + return FALSE; + + return TRUE; +} + char * xdg_app_dir_find_remote_ref (XdgAppDir *self, const char *remote, @@ -2809,8 +2826,8 @@ xdg_app_dir_find_remote_ref (XdgAppDir *self, return g_steal_pointer (&runtime_ref); } - if (!ostree_repo_remote_fetch_summary (self->repo, remote, - &summary_bytes, NULL, + if (!xdg_app_dir_remote_fetch_summary (self, remote, + &summary_bytes, cancellable, error)) return NULL; @@ -3175,8 +3192,8 @@ xdg_app_dir_fetch_remote_title (XdgAppDir *self, if (!xdg_app_dir_ensure_repo (self, cancellable, error)) return NULL; - if (!ostree_repo_remote_fetch_summary (self->repo, remote, - &summary_bytes, NULL, + if (!xdg_app_dir_remote_fetch_summary (self, remote, + &summary_bytes, cancellable, error)) return FALSE; @@ -3576,8 +3593,8 @@ xdg_app_dir_fetch_ref_cache (XdgAppDir *self, if (!xdg_app_dir_ensure_repo (self, cancellable, error)) return FALSE; - if (!ostree_repo_remote_fetch_summary (self->repo, remote_name, - &summary_bytes, NULL, + if (!xdg_app_dir_remote_fetch_summary (self, remote_name, + &summary_bytes, cancellable, error)) return NULL; |