Description: Use PackageKit debconf socket Author: Julian Andres Klode Bug-Ubuntu: https://bugs.launchpad.net/bugs/1726068 Last-Update: 2019-05-24 --- 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