summaryrefslogtreecommitdiff
path: root/src/ostree/ot-remote-builtin-add.c
diff options
context:
space:
mode:
authorDenis Pynkin <denis.pynkin@collabora.com>2019-05-21 01:35:25 +0300
committerAtomic Bot <atomic-devel@projectatomic.io>2019-08-01 02:06:47 +0000
commit0108e9ea4977ac730b5064b8198fe0ffd74df767 (patch)
tree558492822515c22316a04d06c2d6a8a521882813 /src/ostree/ot-remote-builtin-add.c
parente187f240fc399f8d9d769cec631e1d046e065066 (diff)
downloadostree-0108e9ea4977ac730b5064b8198fe0ffd74df767.tar.gz
gpg: conditionally build GPG-related code for sign/verification
Do not build the code related to GPG sign and verification if GPGME support is disabled. Public functions return error 'G_IO_ERROR_NOT_SUPPORTED' in case if gpg-related check is rquested. Signed-off-by: Denis Pynkin <denis.pynkin@collabora.com> Closes: #1889 Approved by: cgwalters
Diffstat (limited to 'src/ostree/ot-remote-builtin-add.c')
-rw-r--r--src/ostree/ot-remote-builtin-add.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/ostree/ot-remote-builtin-add.c b/src/ostree/ot-remote-builtin-add.c
index 2d021d77..cea0b274 100644
--- a/src/ostree/ot-remote-builtin-add.c
+++ b/src/ostree/ot-remote-builtin-add.c
@@ -133,10 +133,12 @@ ot_remote_builtin_add (int argc, char **argv, OstreeCommandInvocation *invocatio
subkey, g_variant_new_variant (g_variant_new_string (subvalue)));
}
+#ifndef OSTREE_DISABLE_GPGME
if (opt_no_gpg_verify)
g_variant_builder_add (optbuilder, "{s@v}",
"gpg-verify",
g_variant_new_variant (g_variant_new_boolean (FALSE)));
+#endif /* OSTREE_DISABLE_GPGME */
if (opt_collection_id != NULL)
g_variant_builder_add (optbuilder, "{s@v}", "collection-id",
@@ -157,6 +159,7 @@ ot_remote_builtin_add (int argc, char **argv, OstreeCommandInvocation *invocatio
cancellable, error))
goto out;
+#ifndef OSTREE_DISABLE_GPGME
/* This is just a convenience option and is not as flexible as the full
* "ostree remote gpg-import" command. It imports all keys from a file,
* which is likely the most common case.
@@ -183,6 +186,7 @@ ot_remote_builtin_add (int argc, char **argv, OstreeCommandInvocation *invocatio
g_print ("Imported %u GPG key%s to remote \"%s\"\n",
imported, (imported == 1) ? "" : "s", remote_name);
}
+#endif /* OSTREE_DISABLE_GPGME */
ret = TRUE;
out: