[ostree] repo: Add ostree_repo_remote_get_gpg_verify()
- From: Matthew Barnes <mbarnes src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [ostree] repo: Add ostree_repo_remote_get_gpg_verify()
- Date: Thu, 16 Apr 2015 22:17:03 +0000 (UTC)
commit 54bf665521a2649a56df48003a1df363fdedc260
Author: Matthew Barnes <mbarnes redhat com>
Date: Wed Apr 15 14:14:55 2015 -0400
repo: Add ostree_repo_remote_get_gpg_verify()
Trivial function, but it does at least centralize the default value.
doc/ostree-sections.txt | 1 +
src/libostree/ostree-repo-pull.c | 5 ++---
src/libostree/ostree-repo.c | 23 +++++++++++++++++++++++
src/libostree/ostree-repo.h | 5 +++++
4 files changed, 31 insertions(+), 3 deletions(-)
---
diff --git a/doc/ostree-sections.txt b/doc/ostree-sections.txt
index 5dd6a2b..efb160f 100644
--- a/doc/ostree-sections.txt
+++ b/doc/ostree-sections.txt
@@ -231,6 +231,7 @@ OstreeRepoRemoteChange
ostree_repo_remote_change
ostree_repo_remote_list
ostree_repo_remote_get_url
+ostree_repo_remote_get_gpg_verify
ostree_repo_get_parent
ostree_repo_write_config
OstreeRepoTransactionStats
diff --git a/src/libostree/ostree-repo-pull.c b/src/libostree/ostree-repo-pull.c
index a70fd65..7597519 100644
--- a/src/libostree/ostree-repo-pull.c
+++ b/src/libostree/ostree-repo-pull.c
@@ -1696,9 +1696,8 @@ ostree_repo_pull_with_options (OstreeRepo *self,
{
pull_data->remote_name = g_strdup (remote_name_or_baseurl);
- if (!_ostree_repo_get_remote_boolean_option (self,
- remote_name_or_baseurl, "gpg-verify",
- TRUE, &pull_data->gpg_verify, error))
+ if (!ostree_repo_remote_get_gpg_verify (self, remote_name_or_baseurl,
+ &pull_data->gpg_verify, error))
goto out;
}
diff --git a/src/libostree/ostree-repo.c b/src/libostree/ostree-repo.c
index 2540046..9c27fca 100644
--- a/src/libostree/ostree-repo.c
+++ b/src/libostree/ostree-repo.c
@@ -1068,6 +1068,29 @@ ostree_repo_remote_get_url (OstreeRepo *self,
return ret;
}
+/**
+ * ostree_repo_remote_get_gpg_verify:
+ * @self: Repo
+ * @name: Name of remote
+ * @out_gpg_verify: (out) (allow-none): Remote's GPG option
+ * @error: Error
+ *
+ * Return whether GPG verification is enabled for the remote named @name
+ * through @out_gpg_verify. It is an error if the provided remote does
+ * not exist.
+ *
+ * Returns: %TRUE on success, %FALSE on failure
+ */
+gboolean
+ostree_repo_remote_get_gpg_verify (OstreeRepo *self,
+ const char *name,
+ gboolean *out_gpg_verify,
+ GError **error)
+{
+ return _ostree_repo_get_remote_boolean_option (self, name, "gpg-verify",
+ TRUE, out_gpg_verify, error);
+}
+
static gboolean
ostree_repo_mode_to_string (OstreeRepoMode mode,
const char **out_mode,
diff --git a/src/libostree/ostree-repo.h b/src/libostree/ostree-repo.h
index 7f0c85d..e6614df 100644
--- a/src/libostree/ostree-repo.h
+++ b/src/libostree/ostree-repo.h
@@ -107,6 +107,11 @@ gboolean ostree_repo_remote_get_url (OstreeRepo *self,
char **out_url,
GError **error);
+gboolean ostree_repo_remote_get_gpg_verify (OstreeRepo *self,
+ const char *name,
+ gboolean *out_gpg_verify,
+ GError **error);
+
OstreeRepo * ostree_repo_get_parent (OstreeRepo *self);
gboolean ostree_repo_write_config (OstreeRepo *self,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]