[ostree/wip/pull-depth: 3/5] wip-pull-async
- From: Colin Walters <walters src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [ostree/wip/pull-depth: 3/5] wip-pull-async
- Date: Tue, 28 Oct 2014 01:20:11 +0000 (UTC)
commit 6c7a511e5996c11042d96ee6aeea6a806722d4c1
Author: Colin Walters <walters verbum org>
Date: Mon Oct 27 12:00:11 2014 -0400
wip-pull-async
src/libostree/ostree-repo-pull.c | 27 +++++++++++++++++++++++++++
src/libostree/ostree-repo.c | 30 ++++++++++++++++++++++++++++++
src/libostree/ostree-repo.h | 8 ++++++++
3 files changed, 65 insertions(+), 0 deletions(-)
---
diff --git a/src/libostree/ostree-repo-pull.c b/src/libostree/ostree-repo-pull.c
index 01bbc55..0411ea0 100644
--- a/src/libostree/ostree-repo-pull.c
+++ b/src/libostree/ostree-repo-pull.c
@@ -1235,6 +1235,33 @@ ostree_repo_pull_with_options (OstreeRepo *self,
GError **error)
{
gboolean ret = FALSE;
+ gboolean done = FALSE;
+ GMainContext *ctx;
+
+ /* NOTE - for legacy compatibility reasons, we do NOT push a new
+ * default main context. The original code iterated the caller's,
+ * which is broken, but we need to keep it.
+ *
+ * https://bugzilla.gnome.org/show_bug.cgi?id=737844
+ */
+
+ ctx = g_main_context_ref_thread_default ();
+
+ while (!done)
+ g_main_context_iteration (ctx,
+}
+
+/* Documented in ostree-repo.c */
+gboolean
+ostree_repo_pull_async (OstreeRepo *self,
+ const char *remote_name,
+ GVariant *options,
+ OstreeAsyncProgress *progress,
+ GAsyncReadyCallback callback,
+ gpointer user_data)
+{
+{
+ gboolean ret = FALSE;
GHashTableIter hash_iter;
gpointer key, value;
gboolean tls_permissive = FALSE;
diff --git a/src/libostree/ostree-repo.c b/src/libostree/ostree-repo.c
index 5ffb8d9..f9e2f7f 100644
--- a/src/libostree/ostree-repo.c
+++ b/src/libostree/ostree-repo.c
@@ -2221,6 +2221,36 @@ ostree_repo_pull_with_options (OstreeRepo *self,
return FALSE;
}
+/**
+ * ostree_repo_pull_async:
+ * @self: Repo
+ * @remote_name: Name of remote
+ * @options: A GVariant a{sv} with an extensible set of flags.
+ * @progress: (allow-none): Progress
+ * @cancellable: Cancellable
+ * @cancellable: Cancellable
+ *
+ * Like ostree_repo_pull(), but supports an extensible set of flags.
+ * The following are currently defined:
+ *
+ * * subdir (s): Pull just this subdirectory
+ * * flags (i): An instance of #OstreeRepoPullFlags
+ * * refs: (as): Array of string refs
+ */
+gboolean
+ostree_repo_pull_async (OstreeRepo *self,
+ const char *remote_name,
+ GVariant *options,
+ OstreeAsyncProgress *progress,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data)
+{
+ g_set_error_literal (error, G_IO_ERROR, G_IO_ERROR_NOT_SUPPORTED,
+ "This version of ostree was built without libsoup, and cannot fetch over HTTP");
+ return FALSE;
+}
+
#endif
/**
diff --git a/src/libostree/ostree-repo.h b/src/libostree/ostree-repo.h
index 9c774cb..19fe712 100644
--- a/src/libostree/ostree-repo.h
+++ b/src/libostree/ostree-repo.h
@@ -567,6 +567,14 @@ gboolean ostree_repo_pull_with_options (OstreeRepo *self,
GCancellable *cancellable,
GError **error);
+gboolean ostree_repo_pull_async (OstreeRepo *self,
+ const char *remote_name,
+ GVariant *options,
+ OstreeAsyncProgress *progress,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+
gboolean ostree_repo_sign_commit (OstreeRepo *self,
const gchar *commit_checksum,
const gchar *key_id,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]