Make various operation work without a system installation

This makes info, list, remotes, and search work if there is no
system flatpak repo. Before it failed with EPERM.

Closes: #1742
Approved by: alexlarsson
This commit is contained in:
Alexander Larsson
2018-05-31 18:12:30 +02:00
committed by Atomic Bot
parent aff4c1f4fc
commit ffe1b7e349
5 changed files with 6 additions and 5 deletions

View File

@@ -398,7 +398,7 @@ flatpak_complete_info (FlatpakCompletion *completion)
context = g_option_context_new ("");
if (!flatpak_option_context_parse (context, options, &completion->argc, &completion->argv,
FLATPAK_BUILTIN_FLAG_ALL_DIRS, &dirs, NULL, NULL))
FLATPAK_BUILTIN_FLAG_ALL_DIRS|FLATPAK_BUILTIN_FLAG_OPTIONAL_REPO, &dirs, NULL, NULL))
return FALSE;
kinds = FLATPAK_KINDS_APP | FLATPAK_KINDS_RUNTIME;

View File

@@ -54,7 +54,7 @@ flatpak_builtin_list_remotes (int argc, char **argv, GCancellable *cancellable,
g_option_context_set_translation_domain (context, GETTEXT_PACKAGE);
if (!flatpak_option_context_parse (context, options, &argc, &argv,
FLATPAK_BUILTIN_FLAG_STANDARD_DIRS, &dirs, cancellable, error))
FLATPAK_BUILTIN_FLAG_STANDARD_DIRS|FLATPAK_BUILTIN_FLAG_OPTIONAL_REPO, &dirs, cancellable, error))
return FALSE;
if (argc > 1)

View File

@@ -313,7 +313,7 @@ flatpak_builtin_list (int argc, char **argv, GCancellable *cancellable, GError *
g_option_context_set_translation_domain (context, GETTEXT_PACKAGE);
if (!flatpak_option_context_parse (context, options, &argc, &argv,
FLATPAK_BUILTIN_FLAG_ALL_DIRS,
FLATPAK_BUILTIN_FLAG_ALL_DIRS|FLATPAK_BUILTIN_FLAG_OPTIONAL_REPO,
&dirs, cancellable, error))
return FALSE;

View File

@@ -243,7 +243,8 @@ flatpak_builtin_search (int argc, char **argv, GCancellable *cancellable, GError
g_option_context_set_translation_domain (context, GETTEXT_PACKAGE);
if (!flatpak_option_context_parse (context, options, &argc, &argv,
FLATPAK_BUILTIN_FLAG_STANDARD_DIRS, &dirs, cancellable, error))
FLATPAK_BUILTIN_FLAG_STANDARD_DIRS | FLATPAK_BUILTIN_FLAG_OPTIONAL_REPO,
&dirs, cancellable, error))
return FALSE;
if (argc < 2)

View File

@@ -8997,7 +8997,7 @@ flatpak_dir_get_all_installed_refs (FlatpakDir *self,
g_autoptr(GHashTable) local_refs = NULL;
int i;
if (!flatpak_dir_ensure_repo (self, NULL, error))
if (!flatpak_dir_maybe_ensure_repo (self, NULL, error))
return NULL;
local_refs = g_hash_table_new_full (flatpak_collection_ref_hash,