[gnome-software] packagekit: Add configure option to use autoremove feature



commit e5272e58c46d7049e7ff6515000477e57a35c5df
Author: Robert Ancell <robert ancell canonical com>
Date:   Thu May 24 13:29:46 2018 +1200

    packagekit: Add configure option to use autoremove feature

 meson.build                               | 5 +++++
 meson_options.txt                         | 1 +
 plugins/packagekit/gs-plugin-packagekit.c | 2 +-
 3 files changed, 7 insertions(+), 1 deletion(-)
---
diff --git a/meson.build b/meson.build
index b9ab7028..b83e9b63 100644
--- a/meson.build
+++ b/meson.build
@@ -138,6 +138,11 @@ if get_option('enable-packagekit')
   conf.set('HAVE_PACKAGEKIT', '1')
   add_project_arguments('-DI_KNOW_THE_PACKAGEKIT_GLIB2_API_IS_SUBJECT_TO_CHANGE',
                         language : 'c')
+  if get_option('enable-packagekit-autoremove')
+      conf.set('GS_PACKAGEKIT_AUTOREMOVE', 'TRUE')
+  else
+      conf.set('GS_PACKAGEKIT_AUTOREMOVE', 'FALSE')
+  endif
 endif
 
 if get_option('enable-fwupd')
diff --git a/meson_options.txt b/meson_options.txt
index b7699e5f..4d7f4986 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -3,6 +3,7 @@ option('enable-gspell', type : 'boolean', value : true, description : 'enable gs
 option('enable-gnome-desktop', type : 'boolean', value : true, description : 'enable gnome-desktop')
 option('enable-man', type : 'boolean', value : true, description : 'enable man pages')
 option('enable-packagekit', type : 'boolean', value : true, description : 'enable PackageKit support')
+option('enable-packagekit-autoremove', type : 'boolean', value : false, description : 'autoremove packages 
in PackageKit')
 option('enable-polkit', type : 'boolean', value : true, description : 'enable PolKit support')
 option('enable-fwupd', type : 'boolean', value : true, description : 'enable fwupd support')
 option('enable-flatpak', type : 'boolean', value : true, description : 'enable Flatpak support')
diff --git a/plugins/packagekit/gs-plugin-packagekit.c b/plugins/packagekit/gs-plugin-packagekit.c
index bfd63ea9..920ddb50 100644
--- a/plugins/packagekit/gs-plugin-packagekit.c
+++ b/plugins/packagekit/gs-plugin-packagekit.c
@@ -530,7 +530,7 @@ gs_plugin_app_remove (GsPlugin *plugin,
        gs_app_set_state (app, AS_APP_STATE_REMOVING);
        results = pk_task_remove_packages_sync (priv->task,
                                                package_ids,
-                                               TRUE, FALSE,
+                                               TRUE, GS_PACKAGEKIT_AUTOREMOVE,
                                                cancellable,
                                                gs_plugin_packagekit_progress_cb, &data,
                                                error);


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