{"action":"opened","issue":{"url":"https://api.github.com/repos/flatpak/flatpak/issues/1402","repository_url":"https://api.github.com/repos/flatpak/flatpak","labels_url":"https://api.github.com/repos/flatpak/flatpak/issues/1402/labels{/name}","comments_url":"https://api.github.com/repos/flatpak/flatpak/issues/1402/comments","events_url":"https://api.github.com/repos/flatpak/flatpak/issues/1402/events","html_url":"https://github.com/flatpak/flatpak/issues/1402","id":295908898,"number":1402,"title":"Component mismatch during appstream icon extraction","user":{"login":"fenryxo","id":853706,"avatar_url":"https://avatars1.githubusercontent.com/u/853706?v=4","gravatar_id":"","url":"https://api.github.com/users/fenryxo","html_url":"https://github.com/fenryxo","followers_url":"https://api.github.com/users/fenryxo/followers","following_url":"https://api.github.com/users/fenryxo/following{/other_user}","gists_url":"https://api.github.com/users/fenryxo/gists{/gist_id}","starred_url":"https://api.github.com/users/fenryxo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fenryxo/subscriptions","organizations_url":"https://api.github.com/users/fenryxo/orgs","repos_url":"https://api.github.com/users/fenryxo/repos","events_url":"https://api.github.com/users/fenryxo/events{/privacy}","received_events_url":"https://api.github.com/users/fenryxo/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-02-09T15:30:08Z","updated_at":"2018-02-09T15:30:08Z","closed_at":null,"author_association":"NONE","body":"Flatpak 0.10.2.1\r\n\r\nComponents (without `.desktop`): eu.tiliado.Nuvola, eu.tiliado.NuvolaAppAmazonCloudPlayer, eu.tiliado.NuvolaAppDeezer, ...\r\n\r\nSteps to reproduce: `flatpak build-update-repo -vv`\r\n\r\nExpected result: Each component gets the corresponding ID.png icon.\r\n\r\nActual result: When icons for the eu.tiliado.Nuvola component are extracted, flatpak looks for eu.tiliado.NuvolaAppAmazonCloudPlayer.png icons saying \"No icon at size ...\".\r\n\r\n\r\n```\r\n$ flatpak build-update-repo -vv\r\nUpdating appstream branch\r\nExtracting icons for component eu.tiliado.NuvolaAppAmazonCloudPlayer.desktop\r\nExtracting icons for component eu.tiliado.NuvolaAppDeezer.desktop\r\nExtracting icons for component eu.tiliado.NuvolaAppAmazonCloudPlayer.desktop\r\nF: No icon at size 64x64: /files/share/app-info/icons/flatpak/64x64/eu.tiliado.NuvolaAppAmazonCloudPlayer.png\r\nF: No icon at size 128x128: /files/share/app-info/icons/flatpak/128x128/eu.tiliado.NuvolaAppAmazonCloudPlayer.png\r\nF: Not updating appstream/x86_64, no change\r\nUpdating summary\r\n```\r\n\r\nThe mismatch occurs in `extract_appstream()` function (`common/flatpak_utils.c`):\r\n\r\n```c\r\nif (!g_str_has_prefix (component_id_text, id) ||\r\n    !g_str_has_suffix (component_id_text, \".desktop\"))\r\n  {\r\n    component = component->next_sibling;\r\n    continue;\r\n  }\r\n```\r\n\r\nThis seems to work, but there probably is a reason why a simple strict match is not used.\r\n\r\n```c\r\ng_autofree char *id_desktop = g_strconcat (id, \".desktop\", NULL);\r\n...\r\n\r\nif (!g_str_equal(component_id_text, id_desktop))\r\n  {\r\n    component = component->next_sibling;\r\n    continue;\r\n  }\r\n```"}}
{"actor":{"display_login":"fenryxo"}}