gpg: do not fail GPG-related configuration get for remote
authorDenis Pynkin <denis.pynkin@collabora.com>
Wed, 27 Nov 2019 09:21:39 +0000 (12:21 +0300)
committerDenis Pynkin <denis.pynkin@collabora.com>
Wed, 25 Mar 2020 12:23:55 +0000 (15:23 +0300)
We don't need anymore stubs for verification options for remotes
in case if ostree built without GPG support.

Signed-off-by: Denis Pynkin <denis.pynkin@collabora.com>
src/libostree/ostree-repo-pull.c
src/libostree/ostree-repo.c

index c6a94d7247aa10d406d75a41edc0d12de80d2b18..203b34cf482e83bf57850faca620b1ac3d82c757 100644 (file)
@@ -3986,7 +3986,6 @@ ostree_repo_pull_with_options (OstreeRepo             *self,
       g_free (pull_data->remote_name);
       pull_data->remote_name = g_strdup (remote_name_or_baseurl);
 
-#ifndef OSTREE_DISABLE_GPGME
       /* Fetch GPG verification settings from remote if it wasn't already
        * explicitly set in the options. */
       if (!opt_gpg_verify_set)
@@ -3998,7 +3997,6 @@ ostree_repo_pull_with_options (OstreeRepo             *self,
         if (!ostree_repo_remote_get_gpg_verify_summary (self, pull_data->remote_name,
                                                         &pull_data->gpg_verify_summary, error))
           goto out;
-#endif /* OSTREE_DISABLE_GPGME */
       /* Fetch verification settings from remote if it wasn't already
        * explicitly set in the options. */
       if (!opt_sign_verify_set)
@@ -6460,9 +6458,7 @@ ostree_repo_remote_fetch_summary_with_options (OstreeRepo    *self,
   g_autofree char *metalink_url_string = NULL;
   g_autoptr(GBytes) summary = NULL;
   g_autoptr(GBytes) signatures = NULL;
-#ifndef OSTREE_DISABLE_GPGME
   gboolean gpg_verify_summary;
-#endif
   gboolean ret = FALSE;
   gboolean summary_is_from_cache;
 
@@ -6484,7 +6480,6 @@ ostree_repo_remote_fetch_summary_with_options (OstreeRepo    *self,
                                   error))
     goto out;
 
-#ifndef OSTREE_DISABLE_GPGME
   if (!ostree_repo_remote_get_gpg_verify_summary (self, name, &gpg_verify_summary, error))
     goto out;
 
@@ -6538,10 +6533,6 @@ ostree_repo_remote_fetch_summary_with_options (OstreeRepo    *self,
         }
     }
 
-#else
-  g_message ("%s: GPG feature is disabled in a build time", __FUNCTION__);
-#endif /* OSTREE_DISABLE_GPGME */
-
   if (out_summary != NULL)
     *out_summary = g_steal_pointer (&summary);
 
index 3aeecc5c43515ab94acdecd4b8bfd98b764bb7c6..36fde3dcf992773bc5b22f80f4626661b839f424 100644 (file)
@@ -2028,17 +2028,8 @@ ostree_repo_remote_get_gpg_verify (OstreeRepo  *self,
       return TRUE;
     }
 
-#ifndef OSTREE_DISABLE_GPGME
   return ostree_repo_get_remote_boolean_option (self, name, "gpg-verify",
                                                TRUE, out_gpg_verify, error);
-#else
-  g_set_error (error, G_IO_ERROR, G_IO_ERROR_NOT_SUPPORTED,
-               "'%s': GPG feature is disabled in a build time",
-               __FUNCTION__);
-  if (out_gpg_verify != NULL)
-    *out_gpg_verify = FALSE;
-  return FALSE;
-#endif /* OSTREE_DISABLE_GPGME */
 }
 
 /**
@@ -2060,17 +2051,8 @@ ostree_repo_remote_get_gpg_verify_summary (OstreeRepo  *self,
                                            gboolean    *out_gpg_verify_summary,
                                            GError     **error)
 {
-#ifndef OSTREE_DISABLE_GPGME
   return ostree_repo_get_remote_boolean_option (self, name, "gpg-verify-summary",
                                                 FALSE, out_gpg_verify_summary, error);
-#else
-  g_set_error (error, G_IO_ERROR, G_IO_ERROR_NOT_SUPPORTED,
-               "'%s': GPG feature is disabled in a build time",
-               __FUNCTION__);
-  if (out_gpg_verify_summary != NULL)
-    *out_gpg_verify_summary = FALSE;
-  return FALSE;
-#endif /* OSTREE_DISABLE_GPGME */
 }
 
 /**