-
Notifications
You must be signed in to change notification settings - Fork 4
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
Ensure the generated flathub:: values is compliant #101
Ensure the generated flathub:: values is compliant #101
Conversation
According to the spec, <metadata> is not a thing. <custom> is the correct one. https://freedesktop.org/software/appstream/docs/chap-Metadata.html#tag-custom Fixes flathub/flathub#4917
@barthalion ping |
Indeed, Looks like we accidentally resurrected something from the past here. |
Emitting both and patching/backporting this in gnome software asap is the only way out. Fortunately it seems quiet simple. Just should have a followup cleanup issue for some when in the future. |
That isn't even needed to be fixed in GNOME Software! I just noticed it upgrades "metadata" to "custom" in all versions! Honestly I think I should do some refactoring in GS so this is less confusing. I think we may actually be able to completely ditch some of that deprecated stuff to make the code more readable. |
Hmm, yeah, I guess I must have implemented it first with |
The good thing is that you don't need to keep the duplicated value, as GNOME Software and appstream-glib will read |
Website is likely also fine https://github.com/flathub-infra/website/blob/main/backend/app/utils.py#L216 |
Hmm... A bit OT, but did you know that you could get import gi
import yaml
gi.require_version('AppStream', '1.0')
from gi.repository import AppStream
def appstream2dict(xml_fname) -> dict[str, dict]:
mdata = AppStream.Metadata()
mdata.set_locale('ALL')
mdata.set_format_style(AppStream.FormatStyle.CATALOG)
mdata.set_parse_flags(AppStream.ParseFlags.IGNORE_MEDIABASEURL)
with lzma.open(xml_fname, 'r') as f:
xml_catalog_data = str(f.read(), 'utf-8')
mdata.clear_components()
mdata.parse_data(xml_catalog_data, AppStream.FormatKind.YAML)
return yaml.safe_load(mdata.components_to_catalog(AppStream.FormatKind.YAML)) You might not want that for various reasons, but it would be dramatically less code ^^ |
According to the spec, is not a thing. is the correct one.
https://freedesktop.org/software/appstream/docs/chap-Metadata.html#tag-custom
Fixes flathub/flathub#4917