summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhaedrus Leeds <mwleeds@protonmail.com>2022-03-25 12:17:21 -0700
committerAlexander Larsson <alexander.larsson@gmail.com>2022-08-16 10:42:06 +0200
commit60005cfcc2c44c1b4728511f880a5e8c5289fac9 (patch)
tree6a26bc3b0e64ee9ab63a36f199092af82613f9ae
parent298286be2d8ceacc426dedecc0e38a3f82d8aedc (diff)
downloadflatpak-60005cfcc2c44c1b4728511f880a5e8c5289fac9.tar.gz
build-export: Don't warn on missing Exec= if DBusActivatable=true
The Desktop Entry spec says that Exec= is only required if DBusActivatable= is not set to true, so don't emit a warning when Exec= is missing but not required.
-rw-r--r--app/flatpak-builtins-build-export.c19
1 files changed, 10 insertions, 9 deletions
diff --git a/app/flatpak-builtins-build-export.c b/app/flatpak-builtins-build-export.c
index 4924fb92..63b0490d 100644
--- a/app/flatpak-builtins-build-export.c
+++ b/app/flatpak-builtins-build-export.c
@@ -491,8 +491,14 @@ check_refs:
if (!g_key_file_load_from_file (key_file, path, G_KEY_FILE_NONE, error))
return FALSE;
- /* Validate Exec command: The key should be present and – if set to a
- * non-empty value – should point to an existing binary.
+ *activatable = g_key_file_get_boolean (key_file,
+ G_KEY_FILE_DESKTOP_GROUP,
+ G_KEY_FILE_DESKTOP_KEY_DBUS_ACTIVATABLE,
+ NULL);
+
+ /* Validate Exec command: Unless we have DBusActivatable=true the key should
+ * be present and – if set to a non-empty value – should point to an existing
+ * binary.
*
* Empty values are allowed, they will result in the default command being
* run by Flatpak when starting the application.
@@ -501,12 +507,12 @@ check_refs:
G_KEY_FILE_DESKTOP_GROUP,
G_KEY_FILE_DESKTOP_KEY_EXEC,
&local_error);
- if (!command)
+ if (!command && *activatable == FALSE)
{
g_print (_("WARNING: Can't find Exec key in %s: %s\n"), path, local_error->message);
g_clear_error (&local_error);
}
- else if (strlen(command) > 0)
+ else if (command && strlen(command) > 0)
{
argv = g_strsplit (command, " ", 0);
bin_file = convert_app_absolute_path (argv[0], files);
@@ -521,11 +527,6 @@ check_refs:
if (*icon && !g_str_has_prefix (*icon, app_id))
g_print (_("WARNING: Icon not matching app id in %s: %s\n"), path, *icon);
- *activatable = g_key_file_get_boolean (key_file,
- G_KEY_FILE_DESKTOP_GROUP,
- G_KEY_FILE_DESKTOP_KEY_DBUS_ACTIVATABLE,
- NULL);
-
return TRUE;
}