[gnome-software/gnome-3-34] snap: Set sandboxed kudo correctly for snap channels.
- From: Robert Ancell <rancell src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-software/gnome-3-34] snap: Set sandboxed kudo correctly for snap channels.
- Date: Wed, 4 Dec 2019 22:42:14 +0000 (UTC)
commit b7b26fb191c09c7d40a957d3a63afd0fee7d4f4d
Author: Robert Ancell <robert ancell canonical com>
Date: Wed Dec 4 11:40:30 2019 +1300
snap: Set sandboxed kudo correctly for snap channels.
It was previously not set for the alternatives, do it in the refine stage so
this is more reliable.
plugins/snap/gs-plugin-snap.c | 19 +++++++++++++------
1 file changed, 13 insertions(+), 6 deletions(-)
---
diff --git a/plugins/snap/gs-plugin-snap.c b/plugins/snap/gs-plugin-snap.c
index 6ef850a8..c701e2f8 100644
--- a/plugins/snap/gs-plugin-snap.c
+++ b/plugins/snap/gs-plugin-snap.c
@@ -248,7 +248,6 @@ find_snaps (GsPlugin *plugin, SnapdFindFlags flags, const gchar *section, const
static GsApp *
snap_to_app (GsPlugin *plugin, SnapdSnap *snap)
{
- GsPluginData *priv = gs_plugin_get_data (plugin);
GStrv common_ids;
g_autofree gchar *appstream_id = NULL;
g_autofree gchar *unique_id = NULL;
@@ -299,9 +298,6 @@ snap_to_app (GsPlugin *plugin, SnapdSnap *snap)
g_type_class_unref (enum_class);
}
- if (priv->system_confinement == SNAPD_SYSTEM_CONFINEMENT_STRICT && confinement ==
SNAPD_CONFINEMENT_STRICT)
- gs_app_add_kudo (app, GS_APP_KUDO_SANDBOXED);
-
return g_steal_pointer (&app);
}
@@ -852,6 +848,7 @@ gs_plugin_refine_app (GsPlugin *plugin,
GsPluginData *priv = gs_plugin_get_data (plugin);
g_autoptr(SnapdClient) client = NULL;
const gchar *snap_name, *channel, *name;
+ SnapdConfinement confinement = SNAPD_CONFINEMENT_UNKNOWN;
g_autoptr(SnapdSnap) local_snap = NULL;
g_autoptr(SnapdSnap) store_snap = NULL;
SnapdSnap *snap;
@@ -910,6 +907,7 @@ gs_plugin_refine_app (GsPlugin *plugin,
gs_app_add_quirk (app, GS_APP_QUIRK_DEVELOPER_VERIFIED);
snap = local_snap != NULL ? local_snap : store_snap;
+ confinement = snapd_snap_get_confinement (snap);
gs_app_set_version (app, snapd_snap_get_version (snap));
if (channel != NULL && store_snap != NULL) {
@@ -917,11 +915,20 @@ gs_plugin_refine_app (GsPlugin *plugin,
guint i;
for (i = 0; i < channels->len; i++) {
SnapdChannel *c = channels->pdata[i];
- if (g_strcmp0 (snapd_channel_get_name (c), channel) != 0)
- gs_app_set_version (app, snapd_channel_get_version (c));
+
+ if (g_strcmp0 (snapd_channel_get_name (c), channel) == 0)
+ continue;
+
+ gs_app_set_version (app, snapd_channel_get_version (c));
+ confinement = snapd_channel_get_confinement (c);
}
}
+ if (flags & GS_PLUGIN_REFINE_FLAGS_REQUIRE_KUDOS &&
+ priv->system_confinement == SNAPD_SYSTEM_CONFINEMENT_STRICT &&
+ confinement == SNAPD_CONFINEMENT_STRICT)
+ gs_app_add_kudo (app, GS_APP_KUDO_SANDBOXED);
+
switch (snapd_snap_get_snap_type (snap)) {
case SNAPD_SNAP_TYPE_APP:
gs_app_set_kind (app, AS_APP_KIND_DESKTOP);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]