summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2018-09-30 14:45:13 -0400
committerAtomic Bot <atomic-devel@projectatomic.io>2018-10-01 13:05:12 +0000
commit651c86d3c60cdf41e9dea2ce23cc7eb2aacb9b4f (patch)
treed9f829d9e457bfd3fc7c67b7c23c5c3bb0876579
parent2290099eadf7ba481796fc64a16256cb56525ea9 (diff)
downloadflatpak-651c86d3c60cdf41e9dea2ce23cc7eb2aacb9b4f.tar.gz
run: Allow selecting an installation
It may be an unlikely case, but if the same app is installed in multiple installations, there was no way to select which one to run, so far. Closes: #2146 Closes: #2158 Approved by: alexlarsson
-rw-r--r--app/flatpak-builtins-run.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/app/flatpak-builtins-run.c b/app/flatpak-builtins-run.c
index 9d3f981d..dd3d6a1e 100644
--- a/app/flatpak-builtins-run.c
+++ b/app/flatpak-builtins-run.c
@@ -90,6 +90,7 @@ flatpak_builtin_run (int argc, char **argv, GCancellable *cancellable, GError **
g_autofree char *branch = NULL;
FlatpakKinds kinds;
g_autoptr(GError) local_error = NULL;
+ g_autoptr(GPtrArray) dirs = NULL;
context = g_option_context_new (_("APP [args...] - Run an app"));
g_option_context_set_translation_domain (context, GETTEXT_PACKAGE);
@@ -110,7 +111,9 @@ flatpak_builtin_run (int argc, char **argv, GCancellable *cancellable, GError **
arg_context = flatpak_context_new ();
g_option_context_add_group (context, flatpak_context_get_options (arg_context));
- if (!flatpak_option_context_parse (context, options, &argc, &argv, FLATPAK_BUILTIN_FLAG_NO_DIR, NULL, cancellable, error))
+ if (!flatpak_option_context_parse (context, options, &argc, &argv,
+ FLATPAK_BUILTIN_FLAG_ALL_DIRS,
+ &dirs, cancellable, error))
return FALSE;
if (rest_argc == 0)
@@ -146,7 +149,7 @@ flatpak_builtin_run (int argc, char **argv, GCancellable *cancellable, GError **
if (app_ref == NULL)
return FALSE;
- app_deploy = flatpak_find_deploy_for_ref (app_ref, opt_commit, cancellable, &local_error);
+ app_deploy = flatpak_find_deploy_for_ref_in (dirs, app_ref, opt_commit, cancellable, &local_error);
if (app_deploy == NULL &&
(!g_error_matches (local_error, FLATPAK_ERROR, FLATPAK_ERROR_NOT_INSTALLED) ||
(kinds & FLATPAK_KINDS_RUNTIME) == 0))
@@ -168,7 +171,7 @@ flatpak_builtin_run (int argc, char **argv, GCancellable *cancellable, GError **
if (runtime_ref == NULL)
return FALSE;
- runtime_deploy = flatpak_find_deploy_for_ref (runtime_ref, opt_commit ? opt_commit : opt_runtime_commit, cancellable, &local_error2);
+ runtime_deploy = flatpak_find_deploy_for_ref_in (dirs, runtime_ref, opt_commit ? opt_commit : opt_runtime_commit, cancellable, &local_error2);
if (runtime_deploy == NULL)
{
/* Report old app-kind error, as its more likely right */