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



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

    snap: Mark non-app snaps as runtimes

 plugins/snap/gs-plugin-snap.c |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)
---
diff --git a/plugins/snap/gs-plugin-snap.c b/plugins/snap/gs-plugin-snap.c
index 27460c4..cbdfb24 100644
--- a/plugins/snap/gs-plugin-snap.c
+++ b/plugins/snap/gs-plugin-snap.c
@@ -181,10 +181,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]