[packagekit] Help request to make a PK client communicate with debconf

Silvan Calarco silvan.calarco at mambasoft.it
Sun Feb 15 15:05:11 PST 2015


Hi all,
I'm writing a client which uses PackageKit to install packages but I'm 
struggling to make it work with debconf on Ubuntu which provides PackageKit 
0.8. I would like the client to get input from debconf processes (like 
debconf-communicate) but can't get any further from those processes to wait 
for input and hang the whole installation process.
It seems that pk-client-helper.c manages socket and callbacks to do this, but 
it is private so I can't interact directly with it nor setting any callback in 
my daemon. I tried to read/write from the socket in /tmp (by guessing the 
socket filename using the tid got via the progress callback) but with no 
success. I'm using libpackagekit-glib2 (version 0.8), maybe I could do this 
via the dbus interface?
I took the code of pkcon as a reference client implementation: although it 
won't show any interaction with debconf, it at least doesn't lock like my 
client does, but examinating it deeply I noticed that it uses some private 
headers which again made me stuck. pkcon -v (debug) is very useful but debug 
functionality seems to be also private so I can't enable PackageKit debug 
information on my client, which would be useful.
Below is the scheme from pk-client-helper.c, but I can't understand what can I 
do to talk with to debconf from the client (some SetHints?).

In short my question is whether and how a non-gui client app could communicate 
with debconf during packages installation.

Thanks for any help!

Regards,
Silvan

----
/**
 * SECTION:pk-client-helper
 * @short_description: helper object to run a helper session process for the 
lifetime of a transaction
 *
 * This GObject can be used to run a session helper program out of band
 * with the normal PackageKit transaction. This allows an external program
 * such as debconf to be used that needs direct console access.
 *
 *
 *   client ----> packagekit-glib ---> dbus ---> packagekitd ---> apt
 *          .------------^                                         ^
 *   debconf ___________________               (SetHints)          |
 *    | \___|  PkClientHelper   \__.____.____.______/_.____.____.__/
 *    ^-----|___________________/         (socket in tmp)
 *   (stdin & stdout )
 *
 *  \------------.------------------/          \------------.---------/
 *               |                                          |
 *          user session                              system context
 */




More information about the PackageKit mailing list