repo: Add ostree_repo_remote_get_gpg_verify()

Trivial function, but it does at least centralize the default value.
This commit is contained in:
Matthew Barnes 2015-04-15 14:14:55 -04:00
parent d7a6f257a0
commit 54bf665521
4 changed files with 31 additions and 3 deletions

View File

@ -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

View File

@ -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;
}

View File

@ -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,

View File

@ -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,