[packagekit] initial work on the apt dbus backend

Robin Norwood rnorwood at redhat.com
Wed Feb 13 11:23:16 PST 2008


On Wed, 13 Feb 2008 19:04:58 +0000
Richard Hughes <hughsient at gmail.com> wrote:

> On Wed, 2008-02-13 at 20:00 +0100, Sebastian Heinlein wrote:
> > I started to create a dbus based backend for apt. Currently it is
> > more or less a copy and paste combination of the current apt
> > backend and the yum2 one.
> 
> Cool. Do you think any of the yum2 backend stuff could be abstracted?
> Did you think the dbus interface was obvious? The yum2 backend also
> has quite a few problems - for instance I think it exits in the event
> of an error. I would copy it with a pinch of salt.

Yeah, it's very much a WIP.  I'm making some fixes to it today, in
fact.  In addition to the exit-on-error thing, I have a short list:

o The constants issue Richard brought up on the list the other day.

o Need to lock the yum backend in a more granular way than it does now
- ie, at the beginning and end of each transaction, instead of at the
beginning and end of the daemon's life.

o Need to make sure the c backend is killing off the daemon when it
exits, and maybe add a timeout so the yum backend doesn't continue to
live if the c backend goes away unexpectedly.

o Abstraction - I had trouble abstracting the new daemon bits because
of the decorators.  For the dbus.service style interface, each signal
and method needs a decorator:

    @dbus.service.signal(dbus_interface=PACKAGEKIT_DBUS_INTERFACE,
                         signature='ssb')

Since PACKAGEKIT_DBUS_INTERFACE is different per-backend, I'm not sure
if there's a pythonic way to abstract that into a base class, but keep
the PACKAGEKIT_DBUS_INTERFACE constant per-child-class.  Anyone with
python skills know?  That way most of the signals could just go in the
base class, like the old yum/python backends.

Lots of other stuff, I'm sure.

-RN

-- 
Robin Norwood
Red Hat, Inc.

"The Sage does nothing, yet nothing remains undone."
-Lao Tzu, Te Tao Ching



More information about the PackageKit mailing list