[gnome-software/gnome-3-30] flatpak: Drop the X-Flatpak key fallback and rely on new appstream-glib instead



commit 195fde23a84ce56566c178b7de118ff3bb48a565
Author: Kalev Lember <klember redhat com>
Date:   Thu Nov 29 15:42:59 2018 +0100

    flatpak: Drop the X-Flatpak key fallback and rely on new appstream-glib instead
    
    I got the fallback wrong in commit af05c3e and it broke the self tests
    with older appstream-glib. Let's just do what hughsie suggested in the
    first place and depend on new enough appstream-glib instead.

 .gitlab-ci.yml               |  1 +
 meson.build                  |  2 +-
 plugins/flatpak/gs-flatpak.c | 20 --------------------
 3 files changed, 2 insertions(+), 21 deletions(-)
---
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 4376c5bc..b1bdc853 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -6,6 +6,7 @@ stages:
 before_script:
   # Update and use base build deps
   - dnf update -y && dnf -y install dnf-plugins-core @buildsys-build
+  - dnf install -y 
https://people.freedesktop.org/~hughsient/temp/libappstream-glib-0.7.14-0.641.20181015git.fc29.x86_64.rpm 
https://people.freedesktop.org/~hughsient/temp/libappstream-glib-devel-0.7.14-0.641.20181015git.fc29.x86_64.rpm
   - dnf --enablerepo updates-testing -y builddep gnome-software
   # Some deps may not be sync'd
   - dnf -y install rpm-ostree-devel
diff --git a/meson.build b/meson.build
index 797da522..0e092254 100644
--- a/meson.build
+++ b/meson.build
@@ -96,7 +96,7 @@ add_project_arguments('-D_GNU_SOURCE', language : 'c')
 
 conf.set('HAVE_LINUX_UNISTD_H', cc.has_header('linux/unistd.h'))
 
-appstream_glib = dependency('appstream-glib', version : '>= 0.7.3')
+appstream_glib = dependency('appstream-glib', version : '>= 0.7.14')
 gdk_pixbuf = dependency('gdk-pixbuf-2.0', version : '>= 2.32.0')
 gio_unix = dependency('gio-unix-2.0', version : '>= 2.56.0')
 gmodule = dependency('gmodule-2.0')
diff --git a/plugins/flatpak/gs-flatpak.c b/plugins/flatpak/gs-flatpak.c
index 5c7457b3..ffd8927a 100644
--- a/plugins/flatpak/gs-flatpak.c
+++ b/plugins/flatpak/gs-flatpak.c
@@ -393,19 +393,6 @@ gs_flatpak_add_apps_from_xremote (GsFlatpak *self,
        return TRUE;
 }
 
-static gchar *
-gs_flatpak_discard_desktop_suffix (const gchar *app_id)
-{
-       const gchar *desktop_suffix = ".desktop";
-       guint app_prefix_len;
-
-       if (!g_str_has_suffix (app_id, desktop_suffix))
-               return g_strdup (app_id);
-
-       app_prefix_len = strlen (app_id) - strlen (desktop_suffix);
-       return g_strndup (app_id, app_prefix_len);
-}
-
 static void
 gs_flatpak_rescan_installed (GsFlatpak *self,
                             GCancellable *cancellable,
@@ -447,13 +434,6 @@ gs_flatpak_rescan_installed (GsFlatpak *self,
                        continue;
                }
 
-               /* fall back to guessing app ID */
-               if (as_app_get_id (app) == NULL) {
-                       g_autofree gchar *app_id = gs_flatpak_discard_desktop_suffix (fn);
-                       g_debug ("failed to get app ID from X-Flatpak; falling back to %s", app_id);
-                       as_app_set_id (app, app_id);
-               }
-
                /* fix up icons */
                icons = as_app_get_icons (app);
                for (guint i = 0; i < icons->len; i++) {


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