• Matthew Leeds's avatar
    flatpak: Set apps to installed upon missing runtime install · 87b8de86
    Matthew Leeds authored
    This commit is a rework of
    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 ..."
gs-flatpak-transaction.c 26.7 KB