aboutsummaryrefslogtreecommitdiff
path: root/debian/patches/pk-debconf-helper.patch
blob: 9e672c7c58a44275002dba8a3f4d907ecda2d5b3 (plain) (blame)
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
Description: Use PackageKit debconf socket
Author: Julian Andres Klode <julian.klode@canonical.com>
Bug-Ubuntu: https://bugs.launchpad.net/bugs/1726068
Last-Update: 2019-05-24 <YYYY-MM-DD, last update of the meta-information, optional>
---
This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
--- a/aptdaemon/client.py
+++ b/aptdaemon/client.py
@@ -888,6 +888,16 @@ class AptTransaction(GObject.Object):
             _reply_handler = lambda: reply_handler(self)
         else:
             _reply_handler = None
+
+        pk_socket = "/run/user/%d/pk-debconf-socket" % os.getuid()
+        if os.path.exists(pk_socket):
+            self._proxy.Set("org.debian.apt.transaction", "DebconfSocket",
+                pk_socket,
+                dbus_interface=dbus.PROPERTIES_IFACE,
+                reply_handler=_reply_handler,
+                error_handler=error_handler)
+            return
+
         self._debconf_helper = debconf.DebconfProxy(frontend)
         self._proxy.Set("org.debian.apt.transaction", "DebconfSocket",
                         self._debconf_helper.socket_path,
--- a/aptdaemon/core.py
+++ b/aptdaemon/core.py
@@ -368,7 +368,11 @@ class Transaction(DBusObject):
         self.pid = pid
         self.http_proxy = dbus.String("")
         self.terminal = dbus.String("")
-        self.debconf = dbus.String("")
+        pk_socket = "/run/user/%d/pk-debconf-socket" % self.uid
+        if os.path.exists(pk_socket):
+            self.debconf = dbus.String(pk_socket)
+        else:
+            self.debconf = dbus.String("")
         self.kwargs = kwargs
         self._translation = None
         # The transaction which should be executed after this one