[gnome-software: 3/4] appstream: Search for source-file as component children first




commit 29c18e5ab072bdfc529c611f7cf288d018446ca7
Author: Pablo Correa Gómez <ablocorrea hotmail com>
Date:   Sat Mar 5 01:46:30 2022 +0100

    appstream: Search for source-file as component children first
    
    For appdata and desktop files, the "info" node is a children of "component"
    and not a sibling, contrary to what happens in distribution appstream files.

 lib/gs-appstream.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
---
diff --git a/lib/gs-appstream.c b/lib/gs-appstream.c
index 2a809cd50..14cf8887f 100644
--- a/lib/gs-appstream.c
+++ b/lib/gs-appstream.c
@@ -1000,7 +1000,9 @@ gs_appstream_refine_app (GsPlugin *plugin,
                gs_app_set_id (app, tmp);
 
        /* set source */
-       tmp = xb_node_query_text (component, "../info/filename", NULL);
+       tmp = xb_node_query_text (component, "info/filename", NULL);
+       if (tmp == NULL)
+               tmp = xb_node_query_text (component, "../info/filename", NULL);
        if (tmp != NULL && gs_app_get_metadata_item (app, "appstream::source-file") == NULL) {
                gs_app_set_metadata (app, "appstream::source-file", tmp);
        }


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