From 3ad6fe680cf3804193c8a4fe4f9f6e8840ef3524 Mon Sep 17 00:00:00 2001
From: Matthias Clasen <mclasen@redhat.com>
Date: Wed, 17 Apr 2019 11:40:26 -0400
Subject: [PATCH 1/3] oci: Handle cancellations for appstream
When an appstream update is cancelled while downloading
icons, properly fail. Otherwise, the next update attempt
will see an up-to-date timestamp, think everyhing is ok
and not download the missing icons.
Closes: https://github.com/flatpak/flatpak/issues/2835
Closes: #2836
Approved by: alexlarsson
(cherry picked from commit f28e62add1eb508bbfe97aab94743b129d1422ee)
---
common/flatpak-oci-registry.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/common/flatpak-oci-registry.c b/common/flatpak-oci-registry.c
index fe9afbdd..1a6edb76 100644
--- a/common/flatpak-oci-registry.c
+++ b/common/flatpak-oci-registry.c
@@ -2473,6 +2473,9 @@ flatpak_oci_index_make_appstream (SoupSession *soup_session,
}
}
+ if (g_cancellable_set_error_if_cancelled (cancellable, error))
+ return NULL;
+
if (!flatpak_appstream_xml_root_to_data (appstream_root,
&bytes, NULL, error))
return NULL;
--
2.21.0