Make "flatpak update --appstream" update for all branches

This fixes https://github.com/flatpak/flatpak/issues/331
This commit is contained in:
Alexander Larsson
2016-09-28 18:52:17 +02:00
parent d8ee3c8e72
commit f9c11a8b55

View File

@@ -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;
}