summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Larsson <alexl@redhat.com>2015-09-29 16:12:37 +0200
committerAlexander Larsson <alexl@redhat.com>2015-09-29 16:12:37 +0200
commit8cd95d262104869c2dfffd433abebd08e84b0e3f (patch)
tree48dbdf418bf7301d2301128d61cb54d81da6cffb
parent279558b6bf62ac6972a226ae759785edb986e11b (diff)
downloadxdg-app-8cd95d262104869c2dfffd433abebd08e84b0e3f.tar.gz
Make sure we build against older ostree (without gpg import)
This means we work on the f22 ostree version at least.
-rw-r--r--app/xdg-app-builtins-add-remote.c5
-rw-r--r--configure.ac6
2 files changed, 11 insertions, 0 deletions
diff --git a/app/xdg-app-builtins-add-remote.c b/app/xdg-app-builtins-add-remote.c
index 68d439e..f4fa68f 100644
--- a/app/xdg-app-builtins-add-remote.c
+++ b/app/xdg-app-builtins-add-remote.c
@@ -120,9 +120,14 @@ import_keys (XdgAppDir *dir,
if (!open_source_stream (&input_stream, cancellable, error))
return FALSE;
+#ifdef HAVE_OSTREE_REPO_REMOTE_GPG_IMPORT
if (!ostree_repo_remote_gpg_import (xdg_app_dir_get_repo (dir), remote_name, input_stream,
NULL, &imported, cancellable, error))
return FALSE;
+#else
+ if (FALSE)
+ return xdg_app_fail (error, "gpg key import not supported by libostree, use --no-gpg-verify");
+#endif
/* XXX If we ever add internationalization, use ngettext() here. */
g_print ("Imported %u GPG key%s to remote \"%s\"\n",
diff --git a/configure.ac b/configure.ac
index 4f16cb5..45f73d1 100644
--- a/configure.ac
+++ b/configure.ac
@@ -59,9 +59,15 @@ AC_SUBST(BASE_LIBS)
PKG_CHECK_MODULES(SOUP, [libsoup-2.4])
AC_SUBST(SOUP_CFLAGS)
AC_SUBST(SOUP_LIBS)
+
PKG_CHECK_MODULES(OSTREE, [libgsystem >= 2015.1 ostree-1 >= 2015.3])
AC_SUBST(OSTREE_CFLAGS)
AC_SUBST(OSTREE_LIBS)
+save_LIBS=$LIBS
+LIBS=$OSTREE_LIBS
+AC_CHECK_FUNCS(ostree_repo_remote_gpg_import)
+LIBS=$save_LIBS
+
PKG_CHECK_MODULES(FUSE, [fuse])
AC_SUBST(FUSE_CFLAGS)
AC_SUBST(FUSE_LIBS)