[gnome-software] flatpak: Ensure refining the metadata of apps is not skipped incorrectly
- From: Richard Hughes <rhughes src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-software] flatpak: Ensure refining the metadata of apps is not skipped incorrectly
- Date: Wed, 19 Jun 2019 16:38:26 +0000 (UTC)
commit 635eaef60f91a979903c3d980bcecc73a555e60d
Author: Joaquim Rocha <jrocha endlessm com>
Date: Thu Jun 21 16:09:35 2018 +0200
flatpak: Ensure refining the metadata of apps is not skipped incorrectly
When refining the metadata of apps, it was using the SANDBOXED quirk in
order to skip having to refine it a second time (since it involves IO).
However, that quirk was being set earlier in the function that also sets
the runtime for the app; as a result, when refining updatable apps'
metadata in order to ensure that their runtime is set, if there was a
previous call to the refine which wasn't yet finished, it could end up
skipping the second call before the runtime was set.
This caused a noticeable problem in the Updates page, where the number
updates would vary on every start up (but this is likely not the only
problem).
This patch simply sets the SANDBOXED quirk after everything is done in
the refine, thus allowing it to be correctly used as flag for skipping
further calls to the function.
plugins/flatpak/gs-flatpak.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
---
diff --git a/plugins/flatpak/gs-flatpak.c b/plugins/flatpak/gs-flatpak.c
index 55afbed8..dfb05a36 100644
--- a/plugins/flatpak/gs-flatpak.c
+++ b/plugins/flatpak/gs-flatpak.c
@@ -1842,8 +1842,6 @@ gs_flatpak_set_app_metadata (GsFlatpak *self,
return FALSE;
}
- /* we always get this, but it's a low bar... */
- gs_app_add_kudo (app, GS_APP_KUDO_SANDBOXED);
shared = g_key_file_get_string_list (kf, "Context", "shared", NULL, NULL);
if (shared != NULL) {
/* SHM isn't secure enough */
@@ -1875,6 +1873,9 @@ gs_flatpak_set_app_metadata (GsFlatpak *self,
gs_app_set_runtime (app, app_runtime);
}
+ /* we always get this, but it's a low bar... */
+ gs_app_add_kudo (app, GS_APP_KUDO_SANDBOXED);
+
return TRUE;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]