Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

as_store_from_bytes can't infer the icon path #315

Open
robert-ancell opened this issue Aug 14, 2019 · 4 comments
Open

as_store_from_bytes can't infer the icon path #315

robert-ancell opened this issue Aug 14, 2019 · 4 comments

Comments

@robert-ancell
Copy link
Collaborator

as_store_from_bytes doesn't have any path information so it can't infer the location of the icons in ../icons/ relative to the AppStream XML/YAML. This is what as_store_from_file does (and actually ignores the icon_root parameter passed).

I'm not sure what the appropriate thing is to do here - should as_store_from_bytes have an icon_root parameter or should this information be set elsewhere?

@hughsie
Copy link
Owner

hughsie commented Aug 15, 2019

Do we need the icon path when importing the dep11 file? Surely for gnome-software we just need to set it on the AsIcon directly?

@robert-ancell
Copy link
Collaborator Author

If the icon path is supposed to be derived from the location of the YAML file then we don't need the API specifically in appstream-glib. We can iterate over it later and generate it as necessary.

For example, on my system the YAML for main comes from:
/var/lib/app-info/yaml/archive.ubuntu.com_ubuntu_dists_eoan_main_dep11_Components-amd64.yml.gz
From that you can determine the icon path is /var/lib/app-info/yaml/ubuntu-eoan-main using the Origin field from the AppStream.

I tried setting this path when we parse the YAML in gs-plugin-appstream.c:gs_plugin_appstream_load_desktop_cb but this is converted to XML and the prefix seems to be lost on this step. I think the xmlb data contains both the filename and the origin, so it should be usable at a later stage, but it's not clear to me where that should be done.

robert-ancell added a commit to robert-ancell/appstream-glib that referenced this issue Jan 20, 2020
…m raw data.

Without the filename the icons can't be reliably located.

Fixes hughsie#315
@robert-ancell
Copy link
Collaborator Author

Turns out that GNOME Software is doing the icon path code itself, so this is fixed in https://gitlab.gnome.org/GNOME/gnome-software/merge_requests/408

@robert-ancell
Copy link
Collaborator Author

I made some new AppStream methods that fix the icon path loading in https://github.com/robert-ancell/appstream-glib/tree/as-store-from-bytes-icon-path, not sure if they're still useful.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants