diff options
| author | Matthew Leeds <matthew.leeds@endlessm.com> | 2018-11-02 16:38:56 -0700 |
|---|---|---|
| committer | Atomic Bot <atomic-devel@projectatomic.io> | 2018-11-06 02:48:06 +0000 |
| commit | e6f9353f64bba3dc946a37ee00921b5c8220554e (patch) | |
| tree | bcd11b3a28863f4fbcd700845b3987131100c356 | |
| parent | 85b7eea4f10b9e0d3a28b84f2582e71746be281f (diff) | |
| download | flatpak-e6f9353f64bba3dc946a37ee00921b5c8220554e.tar.gz | |
install: Mention remote in "similar refs" prompt
Currently when the install command has to prompt the user to resolve
ambiguity over which ref to install, the prompt only mentions the
(partial) ref that was specified. If a remote was specified or the user
chose one in a prompt, this is probably fine. But if the user didn't
specify a remote and used the --assumeyes/-y option so that one would be
chosen for them, there's no way to tell which remote is being used at
the point when the ref ambiguity is being resolved. So this commit adds
information about the remote name and flatpak installation to the
"Similar refs found" prompt.
Closes: #2288
Approved by: matthiasclasen
| -rw-r--r-- | app/flatpak-builtins-install.c | 2 | ||||
| -rw-r--r-- | app/flatpak-builtins-utils.c | 7 | ||||
| -rw-r--r-- | app/flatpak-builtins-utils.h | 4 |
3 files changed, 9 insertions, 4 deletions
diff --git a/app/flatpak-builtins-install.c b/app/flatpak-builtins-install.c index 506b2ca8..8298a0c0 100644 --- a/app/flatpak-builtins-install.c +++ b/app/flatpak-builtins-install.c @@ -466,7 +466,7 @@ flatpak_builtin_install (int argc, char **argv, GCancellable *cancellable, GErro return FALSE; } - if (!flatpak_resolve_matching_refs (opt_yes, refs, id, &ref, error)) + if (!flatpak_resolve_matching_refs (remote, dir, opt_yes, refs, id, &ref, error)) return FALSE; if (!flatpak_cli_transaction_add_install (transaction, remote, ref, (const char **) opt_subpaths, error)) diff --git a/app/flatpak-builtins-utils.c b/app/flatpak-builtins-utils.c index deaa358e..9b3f87e1 100644 --- a/app/flatpak-builtins-utils.c +++ b/app/flatpak-builtins-utils.c @@ -407,7 +407,9 @@ flatpak_resolve_duplicate_remotes (GPtrArray *dirs, } gboolean -flatpak_resolve_matching_refs (gboolean disable_interaction, +flatpak_resolve_matching_refs (const char *remote_name, + FlatpakDir *dir, + gboolean disable_interaction, char **refs, const char *opt_search_ref, char **out_ref, @@ -439,7 +441,8 @@ flatpak_resolve_matching_refs (gboolean disable_interaction, if (chosen == 0) { - g_print (_("Similar refs found for ‘%s’:\n"), opt_search_ref); + g_print (_("Similar refs found for ‘%s’ in remote ‘%s’ (%s):\n"), + opt_search_ref, remote_name, flatpak_dir_get_name (dir)); for (i = 0; i < refs_len; i++) g_print ("%d) %s\n", i + 1, refs[i]); chosen = flatpak_number_prompt (0, refs_len, _("Which do you want to use (0 to abort)?")); diff --git a/app/flatpak-builtins-utils.h b/app/flatpak-builtins-utils.h index 6a842d68..b02390ee 100644 --- a/app/flatpak-builtins-utils.h +++ b/app/flatpak-builtins-utils.h @@ -66,7 +66,9 @@ gboolean flatpak_resolve_duplicate_remotes (GPtrArray *dirs, GCancellable *cancellable, GError **error); -gboolean flatpak_resolve_matching_refs (gboolean disable_interaction, +gboolean flatpak_resolve_matching_refs (const char *remote_name, + FlatpakDir *dir, + gboolean disable_interaction, char **refs, const char *opt_search_ref, char **out_ref, |
