[gnome-software/gnome-41: 3/5] appstream: Search for source-file as component children first
- From: Philip Withnall <pwithnall src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-software/gnome-41: 3/5] appstream: Search for source-file as component children first
- Date: Mon, 14 Mar 2022 12:57:29 +0000 (UTC)
commit 4b81771add82035ed67595cb736de9d505e71d54
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 1fe0ca928..491e707ab 100644
--- a/lib/gs-appstream.c
+++ b/lib/gs-appstream.c
@@ -948,7 +948,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]