summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Hughes <richard@hughsie.com>2017-03-15 13:00:17 +0000
committerRichard Hughes <richard@hughsie.com>2017-03-15 13:00:17 +0000
commit8b194ee1824e9fcc1bc76546a4b2101f41e0185c (patch)
treed2a05e1fd002bc15f36bfa3a0de3b86f3a0a158d
parente4069a8b0781dc21f253431eca3f0e45908d652e (diff)
downloadappstream-glib-8b194ee1824e9fcc1bc76546a4b2101f41e0185c.tar.gz
Show a warning if a desktop file is not found when required
This would have helped some head scratching this morning...
-rw-r--r--libappstream-builder/plugins/asb-plugin-desktop.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/libappstream-builder/plugins/asb-plugin-desktop.c b/libappstream-builder/plugins/asb-plugin-desktop.c
index 8e7312f..e41e3e9 100644
--- a/libappstream-builder/plugins/asb-plugin-desktop.c
+++ b/libappstream-builder/plugins/asb-plugin-desktop.c
@@ -246,6 +246,7 @@ asb_plugin_process_app (AsbPlugin *plugin,
const gchar *tmpdir,
GError **error)
{
+ gboolean found = FALSE;
guint i;
const gchar *app_dirs[] = {
"/usr/share/applications",
@@ -263,8 +264,19 @@ asb_plugin_process_app (AsbPlugin *plugin,
if (!asb_plugin_desktop_refine (plugin, pkg, fn,
app, tmpdir, error))
return FALSE;
+ found = TRUE;
}
}
+ /* required */
+ if (!found && as_app_get_kind (AS_APP (app)) == AS_APP_KIND_DESKTOP) {
+ g_set_error (error,
+ ASB_PLUGIN_ERROR,
+ ASB_PLUGIN_ERROR_FAILED,
+ "a desktop file is required for %s",
+ as_app_get_id (AS_APP (app)));
+ return FALSE;
+ }
+
return TRUE;
}