diff --git a/app/flatpak-builtins-update.c b/app/flatpak-builtins-update.c index 07c81e04..0cfd9552 100644 --- a/app/flatpak-builtins-update.c +++ b/app/flatpak-builtins-update.c @@ -63,9 +63,32 @@ update_appstream (FlatpakDir *dir, const char *remote, GCancellable *cancellable { gboolean changed; - if (!flatpak_dir_update_appstream (dir, remote, opt_arch, &changed, - NULL, cancellable, error)) - return FALSE; + if (remote == NULL) + { + g_auto(GStrv) remotes = NULL; + int i; + + remotes = flatpak_dir_list_remotes (dir, cancellable, error); + if (remotes == NULL) + return FALSE; + + for (i = 0; remotes[i] != NULL; i++) + { + if (flatpak_dir_get_remote_disabled (dir, remotes[i])) + continue; + + g_print (_("Updating appstream for remote %s\n"), remotes[i]); + if (!flatpak_dir_update_appstream (dir, remotes[i], opt_arch, &changed, + NULL, cancellable, error)) + return FALSE; + } + } + else + { + if (!flatpak_dir_update_appstream (dir, remote, opt_arch, &changed, + NULL, cancellable, error)) + return FALSE; + } return TRUE; }