Package: gnome-packagekit
Version: 3.22.1-2
Severity: wishlist
Tags: patch

Ubuntu has one remaining diff for gnome-packagekit. Here's an updated
version of your prefer-software-properties.patch that should work for
both Debian and Ubuntu.

Also, you have an extra new line in your debian/patches/series .
Interestingly it causes 'gbp pq' to fail. I'll file a bug against
git-buildpackage for that.

Thanks,
Jeremy Bicha
From: Matthias Klumpp <[email protected]>
Date: Thu, 22 Dec 2016 18:10:24 +0100
Subject: Prefer software-properties-gtk and update-manager
 This patch makes GPK use software-properties-gtk instead of gpk-prefs and
 update-manager instead of gpk-update-viewer if the former is available on
 the system.

---
 src/gpk-application.c | 17 ++++++++++++++---
 1 file changed, 14 insertions(+), 3 deletions(-)

diff --git a/src/gpk-application.c b/src/gpk-application.c
index b5b63db..48630c2 100644
--- a/src/gpk-application.c
+++ b/src/gpk-application.c
@@ -2202,12 +2202,18 @@ gpk_application_activate_sources_cb (GSimpleAction *action,
 	GpkApplicationPrivate *priv = user_data;
 	GtkWidget *window;
 	guint xid;
+	g_autofree gchar *exe = NULL;
 
 	/* get xid */
 	window = GTK_WIDGET (gtk_builder_get_object (priv->builder, "window_manager"));
 	xid = gdk_x11_window_get_xid (gtk_widget_get_window (window));
 
-	command = g_strdup_printf ("%s/gpk-prefs --parent-window %u", BINDIR, xid);
+	exe = g_strdup_printf ("%s/software-properties-gtk", BINDIR);
+	if (g_file_test (exe, G_FILE_TEST_IS_EXECUTABLE))
+		command = g_strdup_printf ("%s -nt %u", exe, xid);
+	else
+		command = g_strdup_printf ("%s/gpk-prefs --parent-window %u", BINDIR, xid);
+
 	g_debug ("running: %s", command);
 	ret = g_spawn_command_line_async (command, NULL);
 	if (!ret)
@@ -2923,7 +2929,10 @@ gpk_application_activate_updates_cb (GSimpleAction *action,
 	g_autofree gchar *command = NULL;
 	g_autoptr(GError) error = NULL;
 
-	command = g_build_filename (BINDIR, "gpk-update-viewer", NULL);
+	command = g_strdup_printf ("%s/update-manager", BINDIR);
+	if (!g_file_test (command, G_FILE_TEST_IS_EXECUTABLE))
+		command = g_build_filename (BINDIR, "gpk-update-viewer", NULL);
+
 	g_debug ("running: %s", command);
 	ret = g_spawn_command_line_async (command, &error);
 	if (!ret)
@@ -2999,7 +3008,9 @@ main (int argc, char *argv[])
 					 G_N_ELEMENTS (gpk_menu_app_entries),
 					 priv);
 
-	filename = g_build_filename (BINDIR, "gpk-update-viewer", NULL);
+	filename = g_strdup_printf ("%s/update-manager", BINDIR);
+	if (!g_file_test (filename, G_FILE_TEST_IS_EXECUTABLE))
+		filename = g_build_filename (BINDIR, "gpk-update-viewer", NULL);
 	if (!g_file_test (filename, G_FILE_TEST_IS_EXECUTABLE)) {
 		GAction *action = g_action_map_lookup_action (G_ACTION_MAP (priv->application), "updates");
 		g_simple_action_set_enabled (G_SIMPLE_ACTION (action), FALSE);

Reply via email to