[gnome-software/uajain/fix-real-appdata-query] appstream: Also query the real appdata files during refine



commit 2b741bee098b4adafb981ce6e801840e90a18e54
Author: Umang Jain <mailumangjain gmail com>
Date:   Wed Sep 11 22:21:37 2019 +0530

    appstream: Also query the real appdata files during refine
    
    Appstream plugin tries to source two XML file for an installed
    app. The first one is the real appdata file (typically present
    at /usr/share/metainfo or similar) and another XML representation
    sourced from the `.desktop` file of the app present at
    `/usr/share/applications`.
    
    During construction of the latter XML representation, appstream
    plugin adds a fixup XML node <pkgname> into the XML. This XML
    representation was then pushed into the silo.
    
    However, during gs_plugin_refine_app, only the latter XML
    representation of the `.desktop` file was queried and the
    components from the real appdata file (at /usr/share/metainfo
    or similar) were skipped. This is evident by looking at the XbSilo
    query which includes components only with <pkgname> tags.
    
    Hence, append the XbSilo query to also include the components
    for app-refine from the real appdata. <description> tag is good
    enough to know if the component is coming from the real appdata.
    
    The bug was noticed inside Endless app-center when the list of
    all installed system apps was missing. This was due to the missing
    description in the GsApp and the gs-installed-page refuse to
    consider those GsApps are real apps.
    
    https://phabricator.endlessm.com/T27668

 plugins/core/gs-plugin-appstream.c | 1 +
 1 file changed, 1 insertion(+)
---
diff --git a/plugins/core/gs-plugin-appstream.c b/plugins/core/gs-plugin-appstream.c
index 7979806b..47be2b8b 100644
--- a/plugins/core/gs-plugin-appstream.c
+++ b/plugins/core/gs-plugin-appstream.c
@@ -721,6 +721,7 @@ gs_plugin_refine_from_id (GsPlugin *plugin,
        xb_string_append_union (xpath, "components/component/id[text()='%s']/../pkgname/..", id);
        xb_string_append_union (xpath, "components/component[@type='webapp']/id[text()='%s']/..", id);
        xb_string_append_union (xpath, "component/id[text()='%s']/../pkgname/..", id);
+       xb_string_append_union (xpath, "component/id[text()='%s']/../description/..", 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))


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