[gnome-software/gnome-3-22] snap: Mark non-app snaps as runtimes



commit 7cb4bb67a454c7c2c6e7aa3a6ad1b141f9a52f6c
Author: Robert Ancell <robert ancell canonical com>
Date:   Wed Jun 28 13:36:50 2017 +0100

    snap: Mark non-app snaps as runtimes

 src/plugins/gs-plugin-snap.c |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)
---
diff --git a/src/plugins/gs-plugin-snap.c b/src/plugins/gs-plugin-snap.c
index 5dea857..49983c6 100644
--- a/src/plugins/gs-plugin-snap.c
+++ b/src/plugins/gs-plugin-snap.c
@@ -179,10 +179,17 @@ snap_to_app (GsPlugin *plugin, JsonObject *snap)
 {
        GsPluginData *priv = gs_plugin_get_data (plugin);
        GsApp *app;
+       const gchar *type;
 
        /* create a unique ID for deduplication, TODO: branch? */
        app = gs_app_new (json_object_get_string_member (snap, "name"));
-       gs_app_set_kind (app, AS_APP_KIND_DESKTOP);
+       type = json_object_get_string_member (snap, "type");
+       if (g_strcmp0 (type, "app") == 0) {
+               gs_app_set_kind (app, AS_APP_KIND_DESKTOP);
+       } else if (g_strcmp0 (type, "gadget") == 0 || g_strcmp0 (type, "os") == 0) {
+               gs_app_set_kind (app, AS_APP_KIND_RUNTIME);
+               gs_app_add_quirk (app, AS_APP_QUIRK_NOT_LAUNCHABLE);
+       }
        gs_app_set_scope (app, AS_APP_SCOPE_SYSTEM);
        gs_app_set_bundle_kind (app, AS_BUNDLE_KIND_SNAP);
        gs_app_set_management_plugin (app, "snap");


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]