From 60005cfcc2c44c1b4728511f880a5e8c5289fac9 Mon Sep 17 00:00:00 2001 From: Phaedrus Leeds Date: Fri, 25 Mar 2022 12:17:21 -0700 Subject: [PATCH] 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. --- app/flatpak-builtins-build-export.c | 19 ++++++++++--------- 1 file 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; }