[gnome-software/gnome-3-22] Do not skip refreshing flatpak remotes if one fails when non-interactive
- From: Kalev Lember <klember src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-software/gnome-3-22] Do not skip refreshing flatpak remotes if one fails when non-interactive
- Date: Mon, 7 Nov 2016 13:37:27 +0000 (UTC)
commit 80a3a6df2eee3df8dba9bb7dcee515c00066a9fd
Author: Richard Hughes <richard hughsie com>
Date: Sat Sep 17 14:05:02 2016 +0100
Do not skip refreshing flatpak remotes if one fails when non-interactive
But, always fail if the refresh is interactive.
(cherry picked from commit 3f70328141f668e1c36c7eb3df61c71ad50d0a85)
src/plugins/gs-flatpak.c | 16 +++++++++++-----
1 files changed, 11 insertions(+), 5 deletions(-)
---
diff --git a/src/plugins/gs-flatpak.c b/src/plugins/gs-flatpak.c
index aa37c8c..728bd74 100644
--- a/src/plugins/gs-flatpak.c
+++ b/src/plugins/gs-flatpak.c
@@ -48,6 +48,7 @@ G_DEFINE_TYPE (GsFlatpak, gs_flatpak, G_TYPE_OBJECT)
static gboolean
gs_flatpak_refresh_appstream (GsFlatpak *self, guint cache_age,
+ GsPluginRefreshFlags flags,
GCancellable *cancellable, GError **error);
static void
@@ -68,7 +69,7 @@ gs_plugin_flatpak_changed_cb (GFileMonitor *monitor,
}
/* if this is a new remote, get the AppStream data */
- if (!gs_flatpak_refresh_appstream (self, G_MAXUINT, NULL, &error_md)) {
+ if (!gs_flatpak_refresh_appstream (self, G_MAXUINT, 0, NULL, &error_md)) {
g_warning ("failed to get initial available data: %s",
error_md->message);
}
@@ -128,6 +129,7 @@ gs_flatpak_setup (GsFlatpak *self, GCancellable *cancellable, GError **error)
static gboolean
gs_flatpak_refresh_appstream (GsFlatpak *self, guint cache_age,
+ GsPluginRefreshFlags flags,
GCancellable *cancellable, GError **error)
{
gboolean ret;
@@ -190,6 +192,11 @@ gs_flatpak_refresh_appstream (GsFlatpak *self, guint cache_age,
GUINT_TO_POINTER (1));
continue;
}
+ if ((flags & GS_PLUGIN_REFRESH_FLAGS_INTERACTIVE) == 0) {
+ g_warning ("Failed to get AppStream metadata: %s",
+ error_local->message);
+ continue;
+ }
g_set_error (error,
GS_PLUGIN_ERROR,
GS_PLUGIN_ERROR_NOT_SUPPORTED,
@@ -403,7 +410,7 @@ gs_flatpak_add_installed (GsFlatpak *self, GsAppList *list,
guint i;
/* if we've never ever run before, get the AppStream data */
- if (!gs_flatpak_refresh_appstream (self, G_MAXUINT,
+ if (!gs_flatpak_refresh_appstream (self, G_MAXUINT, 0,
cancellable,
&error_md)) {
g_warning ("failed to get initial available data: %s",
@@ -662,9 +669,8 @@ gs_flatpak_refresh (GsFlatpak *self,
/* update AppStream metadata */
if (flags & GS_PLUGIN_REFRESH_FLAGS_METADATA) {
- if (!gs_flatpak_refresh_appstream (self,
- cache_age, cancellable,
- error))
+ if (!gs_flatpak_refresh_appstream (self, cache_age, flags,
+ cancellable, error))
return FALSE;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]