[gnome-software/uajain/set-no-interaction: 2/2] flatpak: Let flatpak also know if it is a non-interactive transaction



commit 9896702e3542cb411ab816ad844903c2dcdaea9e
Author: Umang Jain <umang endlessm com>
Date:   Thu Jul 18 12:08:08 2019 +0530

    flatpak: Let flatpak also know if it is a non-interactive transaction
    
    Flatpak should also know if the transaction is a non-interactive
    transaction (for e.g. autoupdates). This will help libflatpak to
    differentiate between a user-initiated vs. background operation
    in cases like, being more conservative about disk-space[1] when
    downloading updates during autoupdates.
    
    [1] https://github.com/flatpak/flatpak/pull/3013

 plugins/flatpak/gs-plugin-flatpak.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
---
diff --git a/plugins/flatpak/gs-plugin-flatpak.c b/plugins/flatpak/gs-plugin-flatpak.c
index fca0d123..0944b4ef 100644
--- a/plugins/flatpak/gs-plugin-flatpak.c
+++ b/plugins/flatpak/gs-plugin-flatpak.c
@@ -412,8 +412,13 @@ _build_transaction (GsPlugin *plugin, GsFlatpak *flatpak,
        FlatpakInstallation *installation;
        g_autoptr(FlatpakTransaction) transaction = NULL;
 
-       /* create transaction */
        installation = gs_flatpak_get_installation (flatpak);
+
+       /* Let flatpak know if it is a background operation */
+       if (!gs_plugin_has_flags (plugin, GS_PLUGIN_FLAGS_INTERACTIVE))
+               flatpak_installation_set_no_interaction (installation, TRUE);
+
+       /* create transaction */
        transaction = gs_flatpak_transaction_new (installation, cancellable, error);
        if (transaction == NULL) {
                g_prefix_error (error, "failed to build transaction: ");


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]