[gnome-software/wip/hughsie/libxmlb] f



commit 04774b5b3c87d7eb0e2e6274f76ddbd33e026b26
Author: Richard Hughes <richard hughsie com>
Date:   Sat Oct 13 10:10:29 2018 +0100

    f

 plugins/core/gs-appstream.c        |  4 ++--
 plugins/core/gs-plugin-appstream.c | 20 ++++++++------------
 plugins/core/gs-self-test.c        |  1 +
 plugins/dummy/gs-plugin-dummy.c    |  1 +
 plugins/dummy/gs-self-test.c       |  1 +
 plugins/flatpak/gs-flatpak.c       |  6 +++---
 plugins/modalias/gs-self-test.c    |  1 +
 7 files changed, 17 insertions(+), 17 deletions(-)
---
diff --git a/plugins/core/gs-appstream.c b/plugins/core/gs-appstream.c
index 2199237c..f16f6734 100644
--- a/plugins/core/gs-appstream.c
+++ b/plugins/core/gs-appstream.c
@@ -190,7 +190,7 @@ gs_appstream_get_icon_by_kind_and_size (XbNode *component, AsIconKind icon_kind,
 }
 
 static void
-gs_refine_item_icon (GsPlugin *plugin, GsApp *app, XbNode *component)
+gs_appstream_refine_icon (GsPlugin *plugin, GsApp *app, XbNode *component)
 {
        g_autoptr(AsIcon) icon = NULL;
        g_autoptr(XbNode) n = NULL;
@@ -776,7 +776,7 @@ gs_appstream_refine_app (GsPlugin *plugin,
        /* set icon */
        if ((refine_flags & GS_PLUGIN_REFINE_FLAGS_REQUIRE_ICON) > 0 &&
            gs_app_get_icons(app)->len == 0)
-               gs_refine_item_icon (plugin, app, component);
+               gs_appstream_refine_icon (plugin, app, component);
 
        /* set categories */
        if (refine_flags & GS_PLUGIN_REFINE_FLAGS_REQUIRE_CATEGORIES) {
diff --git a/plugins/core/gs-plugin-appstream.c b/plugins/core/gs-plugin-appstream.c
index 2320e9bd..18f3dea0 100644
--- a/plugins/core/gs-plugin-appstream.c
+++ b/plugins/core/gs-plugin-appstream.c
@@ -611,9 +611,9 @@ gs_plugin_refine_from_id (GsPlugin *plugin,
        g_debug ("searching appstream for %s", id);
 
        /* look in AppStream then fall back to AppData */
-       g_string_append_printf (xpath, "components/component/id[text()='%s']/..", id);
+       g_string_append_printf (xpath, "components/component/id[text()='%s']/../pkgname/..", id);
        g_string_append (xpath, "|");
-       g_string_append_printf (xpath, "component/id[text()='%s']/..", id);
+       g_string_append_printf (xpath, "component/id[text()='%s']/../pkgname/..", id);
        components = xb_silo_query (priv->silo, xpath->str, 0, &error_local);
        if (components == NULL) {
                if (g_error_matches (error_local, G_IO_ERROR, G_IO_ERROR_NOT_FOUND))
@@ -729,7 +729,7 @@ gboolean
 gs_plugin_refine_wildcard (GsPlugin *plugin,
                           GsApp *app,
                           GsAppList *list,
-                          GsPluginRefineFlags flags,
+                          GsPluginRefineFlags refine_flags,
                           GCancellable *cancellable,
                           GError **error)
 {
@@ -748,8 +748,8 @@ gs_plugin_refine_wildcard (GsPlugin *plugin,
        if (id == NULL)
                return TRUE;
 
-       /* find all apps when matching any prefixes */
-       xpath = g_strdup_printf ("components/component/id[text()='%s']/..", id);
+       /* find all app with package names when matching any prefixes */
+       xpath = g_strdup_printf ("components/component/id[text()='%s']/../pkgname/..", id);
        components = xb_silo_query (priv->silo, xpath, 0, &error_local);
        if (components == NULL) {
                if (g_error_matches (error_local, G_IO_ERROR, G_IO_ERROR_NOT_FOUND))
@@ -763,18 +763,14 @@ gs_plugin_refine_wildcard (GsPlugin *plugin,
                XbNode *component = g_ptr_array_index (components, i);
                g_autoptr(GsApp) new = NULL;
 
-               /* does the app have an installation method */
-               if (xb_node_query_text (component, "pkgname", NULL) == NULL) {
-                       g_debug ("not using %s for wildcard as no pkgname",
-                                xb_node_query_text (component, "id", NULL));
-                       continue;
-               }
-
                /* new app */
                g_debug ("found component for wildcard %s", id);
                new = gs_appstream_create_app (plugin, priv->silo, component, error);
                if (new == NULL)
                        return FALSE;
+               if (!gs_appstream_refine_app (plugin, new, priv->silo, component,
+                                             refine_flags, error))
+                       return FALSE;
                gs_app_list_add (list, new);
        }
 
diff --git a/plugins/core/gs-self-test.c b/plugins/core/gs-self-test.c
index 3d8fdcac..f70e07f6 100644
--- a/plugins/core/gs-self-test.c
+++ b/plugins/core/gs-self-test.c
@@ -240,6 +240,7 @@ main (int argc, char **argv)
                "  <component type=\"os-upgrade\">\n"
                "    <id>org.fedoraproject.Fedora-25</id>\n"
                "    <summary>Fedora Workstation</summary>\n"
+               "    <pkgname>fedora-release</pkgname>\n"
                "  </component>\n"
                "</components>\n";
        g_setenv ("GS_SELF_TEST_APPSTREAM_XML", xml, TRUE);
diff --git a/plugins/dummy/gs-plugin-dummy.c b/plugins/dummy/gs-plugin-dummy.c
index 9db12879..bddc6b66 100644
--- a/plugins/dummy/gs-plugin-dummy.c
+++ b/plugins/dummy/gs-plugin-dummy.c
@@ -804,6 +804,7 @@ gs_plugin_add_distro_upgrades (GsPlugin *plugin,
        app = gs_app_new ("org.fedoraproject.release-rawhide.upgrade");
        gs_app_set_scope (app, AS_APP_SCOPE_USER);
        gs_app_set_kind (app, AS_APP_KIND_OS_UPGRADE);
+       gs_app_set_bundle_kind (app, AS_BUNDLE_KIND_PACKAGE);
        gs_app_set_state (app, AS_APP_STATE_AVAILABLE);
        gs_app_set_name (app, GS_APP_QUALITY_LOWEST, "Fedora");
        gs_app_set_summary (app, GS_APP_QUALITY_NORMAL,
diff --git a/plugins/dummy/gs-self-test.c b/plugins/dummy/gs-self-test.c
index 4087c905..938b95d0 100644
--- a/plugins/dummy/gs-self-test.c
+++ b/plugins/dummy/gs-self-test.c
@@ -906,6 +906,7 @@ main (int argc, char **argv)
                "  <component type=\"os-upgrade\">\n"
                "    <id>org.fedoraproject.release-rawhide.upgrade</id>\n"
                "    <summary>Release specific tagline</summary>\n"
+               "    <pkgname>fedora-release</pkgname>\n"
                "  </component>\n"
                "</components>\n");
        g_setenv ("GS_SELF_TEST_APPSTREAM_XML", xml, TRUE);
diff --git a/plugins/flatpak/gs-flatpak.c b/plugins/flatpak/gs-flatpak.c
index 8e1d53e1..a0962a7e 100644
--- a/plugins/flatpak/gs-flatpak.c
+++ b/plugins/flatpak/gs-flatpak.c
@@ -482,7 +482,7 @@ gs_flatpak_rescan_appstream_store (GsFlatpak *self,
        g_clear_object (&self->silo);
 
        /* verbose profiling */
-       if (g_getenv ("GS_DEBUG") != NULL) {
+       if (g_getenv ("GS_XMLB_VERBOSE") != NULL) {
                xb_builder_set_profile_flags (builder,
                                              XB_SILO_PROFILE_FLAG_XPATH |
                                              XB_SILO_PROFILE_FLAG_DEBUG);
@@ -2025,7 +2025,7 @@ gs_flatpak_refine_app (GsFlatpak *self,
 
 gboolean
 gs_flatpak_refine_wildcard (GsFlatpak *self, GsApp *app,
-                           GsAppList *list, GsPluginRefineFlags flags,
+                           GsAppList *list, GsPluginRefineFlags refine_flags,
                            GCancellable *cancellable, GError **error)
 {
        const gchar *id;
@@ -2061,7 +2061,7 @@ gs_flatpak_refine_wildcard (GsFlatpak *self, GsApp *app,
                if (new == NULL)
                        return FALSE;
                gs_flatpak_claim_app (self, new);
-               if (!gs_flatpak_refine_app (self, new, flags, cancellable, error))
+               if (!gs_flatpak_refine_app (self, new, refine_flags, cancellable, error))
                        return FALSE;
                gs_app_list_add (list, new);
        }
diff --git a/plugins/modalias/gs-self-test.c b/plugins/modalias/gs-self-test.c
index 1aa11a30..e17ba3f5 100644
--- a/plugins/modalias/gs-self-test.c
+++ b/plugins/modalias/gs-self-test.c
@@ -83,6 +83,7 @@ main (int argc, char **argv)
                "    <id>com.hughski.ColorHug2.driver</id>\n"
                "    <name>ColorHug2</name>\n"
                "    <summary>ColorHug2 Colorimeter Driver</summary>\n"
+               "    <pkgname>colorhug-client</pkgname>\n"
                "    <provides>\n"
                "      <modalias>pci:*</modalias>\n"
                "    </provides>\n"


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