[gnome-software] flatpak: Handle OSTree GPG signature errors
- From: Richard Hughes <rhughes src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-software] flatpak: Handle OSTree GPG signature errors
- Date: Wed, 8 Jan 2020 13:04:49 +0000 (UTC)
commit 0598feb76f6705ce036e978381d8c53d176290db
Author: Philip Withnall <withnall endlessm com>
Date: Thu Oct 10 13:33:48 2019 +0100
flatpak: Handle OSTree GPG signature errors
These are generally emitted by flatpak if the GPG key for a repository
is not installed properly.
Fixes a “can't reliably fixup error” warning.
Signed-off-by: Philip Withnall <withnall endlessm com>
meson.build | 1 +
plugins/flatpak/gs-flatpak-utils.c | 3 +++
plugins/flatpak/meson.build | 1 +
3 files changed, 5 insertions(+)
---
diff --git a/meson.build b/meson.build
index 3e9590ae..c4b422f0 100644
--- a/meson.build
+++ b/meson.build
@@ -167,6 +167,7 @@ endif
if get_option('flatpak')
flatpak = dependency('flatpak', version : '>= 1.0.4')
+ ostree = dependency('ostree-1')
endif
if get_option('malcontent')
diff --git a/plugins/flatpak/gs-flatpak-utils.c b/plugins/flatpak/gs-flatpak-utils.c
index 89cc3cf2..8849da0f 100644
--- a/plugins/flatpak/gs-flatpak-utils.c
+++ b/plugins/flatpak/gs-flatpak-utils.c
@@ -6,6 +6,7 @@
*/
#include <config.h>
+#include <ostree.h>
#include "gs-flatpak-app.h"
#include "gs-flatpak.h"
@@ -45,6 +46,8 @@ gs_flatpak_error_convert (GError **perror)
error->code = GS_PLUGIN_ERROR_FAILED;
break;
}
+ } else if (error->domain == OSTREE_GPG_ERROR) {
+ error->code = GS_PLUGIN_ERROR_NO_SECURITY;
} else {
g_warning ("can't reliably fixup error from domain %s: %s",
g_quark_to_string (error->domain),
diff --git a/plugins/flatpak/meson.build b/plugins/flatpak/meson.build
index 5714b291..0afc5a97 100644
--- a/plugins/flatpak/meson.build
+++ b/plugins/flatpak/meson.build
@@ -3,6 +3,7 @@ deps = [
plugin_libs,
flatpak,
libxmlb,
+ ostree,
]
if get_option('mogwai')
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]