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

Allow .metainfo.xml for AppStream files #1224

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -166,4 +166,4 @@ install(

install(FILES "${PROJECT_SOURCE_DIR}/resources/appimagetool.desktop" DESTINATION share/applications COMPONENT appimagetool EXCLUDE_FROM_ALL)
install(FILES "${PROJECT_SOURCE_DIR}/resources/appimagetool.png" DESTINATION share/icons/hicolor/128x128/apps COMPONENT appimagetool EXCLUDE_FROM_ALL)
install(FILES "${PROJECT_SOURCE_DIR}/resources/usr/share/metainfo/appimagetool.appdata.xml" DESTINATION share/metainfo COMPONENT appimagetool EXCLUDE_FROM_ALL)
install(FILES "${PROJECT_SOURCE_DIR}/resources/usr/share/metainfo/appimagetool.metainfo.xml" DESTINATION share/metainfo COMPONENT appimagetool EXCLUDE_FROM_ALL)
14 changes: 11 additions & 3 deletions src/appimagetool.c
Original file line number Diff line number Diff line change
Expand Up @@ -841,8 +841,16 @@ main (int argc, char *argv[])
char application_id[PATH_MAX];
sprintf (application_id, "%s", basename(desktop_file));
replacestr(application_id, ".desktop", ".appdata.xml");
gchar *appdata_path = g_build_filename(source, "/usr/share/metainfo/", application_id, NULL);
if (! g_file_test(appdata_path, G_FILE_TEST_IS_REGULAR)){
gchar *appstream_path = g_build_filename(source, "/usr/share/metainfo/", application_id, NULL);
if (g_file_test(appstream_path, G_FILE_TEST_IS_REGULAR)){
fprintf (stderr, "WARNING: AppStream files ending with .appdata.xml is deprecated.\n");
fprintf (stderr, " Please use .metainfo.xml instead.\n");
}
else {
replacestr(application_id, ".appdata.xml", ".metainfo.xml");
appstream_path = g_build_filename(source, "/usr/share/metainfo/", application_id, NULL);
}
if (! g_file_test(appstream_path, G_FILE_TEST_IS_REGULAR)){
fprintf (stderr, "WARNING: AppStream upstream metadata is missing, please consider creating it\n");
fprintf (stderr, " in usr/share/metainfo/%s\n", application_id);
fprintf (stderr, " Please see https://www.freedesktop.org/software/appstream/docs/chap-Quickstart.html#sect-Quickstart-DesktopApps\n");
Expand All @@ -868,7 +876,7 @@ main (int argc, char *argv[])
char *args[] = {
"appstream-util",
"validate-relax",
appdata_path,
appstream_path,
NULL
};
g_print("Trying to validate AppStream information with the appstream-util tool\n");
Expand Down