[ostree] repo: Handle "file" remotes in ostree_repo_remote_get_gpg_verify()



commit d4111aeac016d5c51fefc5d84b2da9beb2dfed52
Author: Matthew Barnes <mbarnes redhat com>
Date:   Sat Jun 6 16:32:45 2015 -0400

    repo: Handle "file" remotes in ostree_repo_remote_get_gpg_verify()

 src/libostree/ostree-repo-pull.c |   12 ++++--------
 src/libostree/ostree-repo.c      |   15 +++++++++++++--
 2 files changed, 17 insertions(+), 10 deletions(-)
---
diff --git a/src/libostree/ostree-repo-pull.c b/src/libostree/ostree-repo-pull.c
index 2a4281f..e259e34 100644
--- a/src/libostree/ostree-repo-pull.c
+++ b/src/libostree/ostree-repo-pull.c
@@ -1673,20 +1673,16 @@ ostree_repo_pull_with_options (OstreeRepo             *self,
   if (_ostree_repo_remote_name_is_file (remote_name_or_baseurl))
     {
       baseurl = g_strdup (remote_name_or_baseurl);
-      /* For compatibility with pull-local, don't gpg verify local
-       * pulls.
-       */
-      pull_data->gpg_verify = FALSE;
     }
   else
     {
       pull_data->remote_name = g_strdup (remote_name_or_baseurl);
-
-      if (!ostree_repo_remote_get_gpg_verify (self, remote_name_or_baseurl,
-                                              &pull_data->gpg_verify, error))
-        goto out;
     }
 
+  if (!ostree_repo_remote_get_gpg_verify (self, remote_name_or_baseurl,
+                                          &pull_data->gpg_verify, error))
+    goto out;
+
   pull_data->phase = OSTREE_PULL_PHASE_FETCHING_REFS;
 
   pull_data->fetcher = _ostree_repo_remote_new_fetcher (self, remote_name_or_baseurl, error);
diff --git a/src/libostree/ostree-repo.c b/src/libostree/ostree-repo.c
index 2353ffa..aaeffd5 100644
--- a/src/libostree/ostree-repo.c
+++ b/src/libostree/ostree-repo.c
@@ -1248,8 +1248,19 @@ ostree_repo_remote_get_gpg_verify (OstreeRepo  *self,
                                    gboolean    *out_gpg_verify,
                                    GError     **error)
 {
-  return _ostree_repo_get_remote_boolean_option (self, name, "gpg-verify",
-                                                 TRUE, out_gpg_verify, error);
+  g_return_val_if_fail (OSTREE_IS_REPO (self), FALSE);
+  g_return_val_if_fail (name != NULL, FALSE);
+
+  /* For compatibility with pull-local, don't GPG verify file:// URIs. */
+  if (_ostree_repo_remote_name_is_file (name))
+    {
+      if (out_gpg_verify != NULL)
+        *out_gpg_verify = FALSE;
+      return TRUE;
+    }
+
+ return _ostree_repo_get_remote_boolean_option (self, name, "gpg-verify",
+                                                TRUE, out_gpg_verify, error);
 }
 
 /**


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]