[gnome-software/fix-flatpak-related-progress: 2/2] flatpak: Set apps to installed upon missing runtime install
- From: Matthew Leeds <mwleeds src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-software/fix-flatpak-related-progress: 2/2] flatpak: Set apps to installed upon missing runtime install
- Date: Fri, 10 Jul 2020 04:25:17 +0000 (UTC)
commit 1f3122f07e8904142c70ce45d715f2b06830e0bc
Author: Matthew Leeds <matthew leeds endlessm com>
Date: Wed Jul 8 16:27:09 2020 -0700
flatpak: Set apps to installed upon missing runtime install
This commit is a rework of
https://gitlab.gnome.org/GNOME/gnome-software/-/merge_requests/373
The idea is that when an app's runtime is missing, or one of its
should-download related refs is missing, the app will be returned as
updatable by flatpak_installation_list_installed_refs_for_update(), and
will be subsequently added to a transaction by gnome-software. Progress
updates on the app are calculated using the progress of the related
operations. However if the app itself doesn't need an update,
_transaction_operation_done() will never be called for it and so its
state never gets set to AS_APP_STATE_INSTALLED. Fix this by setting the
app to installed when the related thing is, if the app is being skipped
and the related thing is the last operation in the transaction needed
for the app.
It would be great to add a unit test for this, but there's no way
through the flatpak plugin's API to uninstall an app's runtime without
uninstalling the app, so we'd have to do something tricky like call out
to "flatpak uninstall --force-remove ..."
plugins/flatpak/gs-flatpak-transaction.c | 4 ++++
1 file changed, 4 insertions(+)
---
diff --git a/plugins/flatpak/gs-flatpak-transaction.c b/plugins/flatpak/gs-flatpak-transaction.c
index c76e17f7..a0aea9f5 100644
--- a/plugins/flatpak/gs-flatpak-transaction.c
+++ b/plugins/flatpak/gs-flatpak-transaction.c
@@ -611,6 +611,10 @@ _transaction_operation_done (FlatpakTransaction *transaction,
case FLATPAK_TRANSACTION_OPERATION_INSTALL:
case FLATPAK_TRANSACTION_OPERATION_INSTALL_BUNDLE:
gs_app_set_state (app, AS_APP_STATE_INSTALLED);
+
+#if FLATPAK_CHECK_VERSION(1,7,3)
+ set_skipped_related_apps_to_installed (self, transaction, operation);
+#endif
break;
case FLATPAK_TRANSACTION_OPERATION_UPDATE:
gs_app_set_version (app, gs_app_get_update_version (app));
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]