diff options
author | Richard Hughes <richard@hughsie.com> | 2015-06-29 17:27:18 +0100 |
---|---|---|
committer | Richard Hughes <richard@hughsie.com> | 2015-06-29 17:27:20 +0100 |
commit | 93213c30195ceee08cb2b722fb0f5adb302c9556 (patch) | |
tree | 6df95cbc1f22c12a4204cf1a638c59abfce7e20e | |
parent | 1027e0a150dbaf38c87c213523d938c018397259 (diff) | |
download | appstream-glib-93213c30195ceee08cb2b722fb0f5adb302c9556.tar.gz |
Be less strict when loading incorrect AppData files
If an AppData has an incorrect <id> but otherwise fine basename we can warn,
repair and continue. This only affects applications with type=desktop as others
use MetaInfo files.
-rw-r--r-- | libappstream-builder/plugins/asb-plugin-appdata.c | 27 |
1 files changed, 10 insertions, 17 deletions
diff --git a/libappstream-builder/plugins/asb-plugin-appdata.c b/libappstream-builder/plugins/asb-plugin-appdata.c index b42d617..fdba993 100644 --- a/libappstream-builder/plugins/asb-plugin-appdata.c +++ b/libappstream-builder/plugins/asb-plugin-appdata.c @@ -112,25 +112,18 @@ asb_plugin_process_filename (AsbPlugin *plugin, as_problem_get_message (problem)); } - /* check app id */ + /* check <id> matches, but still accept if missing or incorrect */ tmp = as_app_get_id (appdata); if (tmp == NULL) { - g_set_error (error, - ASB_PLUGIN_ERROR, - ASB_PLUGIN_ERROR_FAILED, - "AppData %s has no ID", - filename); - return FALSE; - } - if (g_strcmp0 (tmp, as_app_get_id (AS_APP (app))) != 0) { - g_set_error (error, - ASB_PLUGIN_ERROR, - ASB_PLUGIN_ERROR_FAILED, - "AppData %s does not match '%s':'%s'", - filename, - tmp, - as_app_get_id (AS_APP (app))); - return FALSE; + asb_package_log (asb_app_get_package (app), + ASB_PACKAGE_LOG_LEVEL_WARNING, + "AppData %s has no ID", filename); + } else if (g_strcmp0 (tmp, as_app_get_id (AS_APP (app))) != 0) { + asb_package_log (asb_app_get_package (app), + ASB_PACKAGE_LOG_LEVEL_WARNING, + "AppData %s does not match '%s':'%s'", + filename, tmp, + as_app_get_id (AS_APP (app))); } /* check license */ |