[gnome-software/fix-flatpak-related-progress: 6/6] flatpak: Set apps to installed upon missing runtime install



commit e311ddc0f302af33687c81beec1a0b83245b07d3
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.

 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 47a3146f..01477f6f 100644
--- a/plugins/flatpak/gs-flatpak-transaction.c
+++ b/plugins/flatpak/gs-flatpak-transaction.c
@@ -606,6 +606,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  /* flatpak 1.7.3 */
                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]