summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert McQueen <rob@endlessm.com>2018-01-31 11:55:31 +0000
committerMatthew Leeds <matthew.leeds@endlessm.com>2018-02-05 22:06:08 -0800
commit52d5aa5a44e2f1c69516e33dda76bacdd8ce5a6b (patch)
tree11aa3f129dd0e363d049b1d4e621b5552d5658bb
parent7cfbd9b29e98b60a4ed1ae512c5564658b756d7e (diff)
downloadflatpak-52d5aa5a44e2f1c69516e33dda76bacdd8ce5a6b.tar.gz
extract_appstream: allow component IDs not to end in .desktop
The appstream spec suggests that IDs should end in .desktop, but does not require it. Make the repo appstream update process permit this so that the appstream and icons are extracted correctly. Closes: #1367 Approved by: pwithnall (cherry picked from commit 6ab657b9100427f3c4c0f19f8695b7b71a417f49)
-rw-r--r--common/flatpak-utils.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/common/flatpak-utils.c b/common/flatpak-utils.c
index 92fab574..28170ff5 100644
--- a/common/flatpak-utils.c
+++ b/common/flatpak-utils.c
@@ -3860,15 +3860,20 @@ extract_appstream (OstreeRepo *repo,
component_id_text_node = flatpak_xml_find (component_id, NULL, NULL);
component_id_text = g_strstrip (g_strdup (component_id_text_node->text));
- if (!g_str_has_prefix (component_id_text, id) ||
- !g_str_has_suffix (component_id_text, ".desktop"))
+
+ /* .desktop suffix in component ID is suggested, not required
+ (unless app ID actually ends in .desktop) */
+ if (g_str_has_suffix (component_id_text, ".desktop") &&
+ !g_str_has_suffix (id, ".desktop"))
+ component_id_text[strlen (component_id_text) - strlen (".desktop")] = 0;
+
+ if (!g_str_has_prefix (component_id_text, id))
{
component = component->next_sibling;
continue;
}
g_print ("Extracting icons for component %s\n", component_id_text);
- component_id_text[strlen (component_id_text) - strlen (".desktop")] = 0;
if (!copy_icon (component_id_text, root, dest, "64x64", &my_error))
{