File: 01_prefer-software-properties.patch

package info (click to toggle)
gnome-packagekit 43.0-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 13,716 kB
  • sloc: ansic: 8,575; xml: 129; python: 89; sh: 74; makefile: 24
file content (57 lines) | stat: -rw-r--r-- 2,196 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
From: Matthias Klumpp <matthias@tenstral.net>
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 or update-manager instead of gpk-update-viewer if
they are available on the system.

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

--- a/src/gpk-application.c
+++ b/src/gpk-application.c
@@ -2201,12 +2201,18 @@
 	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)
@@ -2922,7 +2928,10 @@
 	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)
@@ -2998,7 +3007,9 @@
 					 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);