From bf99c266a82ca186c72bab55fe9b83fd01ea0eba Mon Sep 17 00:00:00 2001 From: Phaedrus Leeds Date: Thu, 31 Mar 2022 12:40:19 -0700 Subject: [PATCH] app: Tweak messages about dependent apps Use a "Info: " prefix which matches the message printed in print_eol_info_message(). Also make the message accurately use either the word "runtime" or "extension" as appropriate. --- app/flatpak-builtins-uninstall.c | 2 +- app/flatpak-cli-transaction.c | 17 +++++++++++++---- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/app/flatpak-builtins-uninstall.c b/app/flatpak-builtins-uninstall.c index f597ecce..62fb47db 100644 --- a/app/flatpak-builtins-uninstall.c +++ b/app/flatpak-builtins-uninstall.c @@ -202,7 +202,7 @@ confirm_runtime_extension_removal (gboolean yes_opt, ref_name = flatpak_decomposed_dup_id (ref); ref_branch = flatpak_decomposed_get_branch (ref); - g_print (_("Applications using the runtime %s%s%s branch %s%s%s:\n"), + g_print (_("Info: applications using the extension %s%s%s branch %s%s%s:\n"), on, ref_name, off, on, ref_branch, off); g_print (" "); for (guint i = 0; i < apps->len; i++) diff --git a/app/flatpak-cli-transaction.c b/app/flatpak-cli-transaction.c index 78a4ea4f..e331a7a9 100644 --- a/app/flatpak-cli-transaction.c +++ b/app/flatpak-cli-transaction.c @@ -775,13 +775,17 @@ check_current_transaction_for_dependent_apps (GPtrArray *apps, static GPtrArray * find_reverse_dep_apps (FlatpakTransaction *transaction, FlatpakDir *dir, - FlatpakDecomposed *ref) + FlatpakDecomposed *ref, + gboolean *out_is_extension) { FlatpakCliTransaction *self = FLATPAK_CLI_TRANSACTION (transaction); g_autoptr(GPtrArray) apps = NULL; g_autoptr(GError) local_error = NULL; - if (flatpak_dir_is_runtime_extension (dir, ref)) + g_assert (out_is_extension); + + *out_is_extension = flatpak_dir_is_runtime_extension (dir, ref); + if (*out_is_extension) { /* Find apps which are using the ref as an extension directly or as an * extension of their runtime. @@ -886,11 +890,16 @@ end_of_lifed_with_rebase (FlatpakTransaction *transaction, if (flatpak_decomposed_is_runtime (ref) && !rebased_to_ref) { - g_autoptr(GPtrArray) apps = find_reverse_dep_apps (transaction, dir, ref); + gboolean is_extension; + g_autoptr(GPtrArray) apps = find_reverse_dep_apps (transaction, dir, ref, &is_extension); if (apps && apps->len > 0) { - g_print (_("Applications using this runtime:\n")); + if (is_extension) + g_print (_("Info: applications using this extension:\n")); + else + g_print (_("Info: applications using this runtime:\n")); + g_print (" "); for (guint i = 0; i < apps->len; i++) {