-
-
Notifications
You must be signed in to change notification settings - Fork 38
Add support for metainfo.xml #55
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
Conversation
|
Thanks @Rosalie241. Not sure we want this ambiguity in AppImages, though. After all, if we allow 2 different file paths in AppImages, then all tools that verify AppImages or integrate them into the system would have to check 2 different file paths as well. |
Tools which want to support normal desktop applications that provide a metainfo/appdata.xml file will also have to check 2 paths though, so I'm not sure if it's a big problem, but I've updated my application (RMG) to use the new metainfo.xml file according to the freedesktop appstream documentation, and now the appimagetool cannot find the appstream data, which isn't ideal either. |
|
Maybe we should just put in a symlink? That would be backwards compatible. |
|
That could be an option but I'm not sure how to do that with the APIs available. |
|
Something roughly along these lines? |
|
FWIW, the "appdata.xml" suffix is deprecated and not used anymore by upstream. It is still supported for backwards compatibility, but should not be used for newer projects/packages. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR adds support for the newer .metainfo.xml AppStream metadata file format while maintaining backward compatibility with the older .appdata.xml format. According to the freedesktop.org AppStream specification, both formats are valid, but metainfo.xml is the current standard.
Key Changes:
- Check for both
.appdata.xmland.metainfo.xmlfiles in the metainfo directory - Prefer
.metainfo.xmlin warning messages when neither file is found - Use whichever file exists when validating with
appstream-util
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| gboolean metadata_exist = g_file_test(metainfo_path, G_FILE_TEST_IS_REGULAR); | ||
|
|
||
| if (! appdata_exist && ! metadata_exist){ |
Copilot
AI
Dec 4, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Variable naming inconsistency: metadata_exist should be named metainfo_exist to match the pattern used for metainfo_id and metainfo_path. The current name could cause confusion since "metadata" is a generic term, while "metainfo" specifically refers to the .metainfo.xml file type being checked.
| gboolean metadata_exist = g_file_test(metainfo_path, G_FILE_TEST_IS_REGULAR); | |
| if (! appdata_exist && ! metadata_exist){ | |
| gboolean metainfo_exist = g_file_test(metainfo_path, G_FILE_TEST_IS_REGULAR); | |
| if (! appdata_exist && ! metainfo_exist){ |
|
Please try whether #121 resolves this. Thanks! |
This adds support for metainfo.xml, appdata.xml is still supported though.
see https://www.freedesktop.org/software/appstream/docs/chap-Metadata.html#spec-component-location