[gnome-software/gnome-3-32] flatpak: Ensure refining the metadata of apps is not skipped incorrectly
- From: Kalev Lember <klember src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-software/gnome-3-32] flatpak: Ensure refining the metadata of apps is not skipped incorrectly
- Date: Thu, 11 Jul 2019 15:42:12 +0000 (UTC)
commit a94c4158679d1b685eef5cc13d8773c30b69c1fe
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 d7e44a9a..c14bdbf5 100644
--- a/plugins/flatpak/gs-flatpak.c
+++ b/plugins/flatpak/gs-flatpak.c
@@ -1838,8 +1838,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 */
@@ -1871,6 +1869,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]