[packagekit] A new backend vtable entry

Richard Hughes hughsient at gmail.com
Wed Oct 14 02:01:51 PDT 2009


[probably only useful to backend maintainers, feel free to ignore otherwise]

At the moment if you fill in the vtable PK_BACKEND_OPTIONS in your
backend the method gets registered as usable by the daemon.
packagekitd needs to know what methods are present before it
advertises roles to the client, and just checks  to see if each
element in the vtable is NULL to do this.

In some backends, for instance apt, we might need to runtime (rather
than compile time) disable certain roles depending on which python
libraries are present. Also, in the yum backend we need to be able to
disable GetDistroUpgrades if the preupgrade binary is not present. I
suspect it will be a similar story for a few other backends, like
disabling GetFiles if a certain tool isn't present.

For this reason I've added a get_roles member which if set non-NULL
returns a bitfield of roles the backend supports. If you leave this
NULL, then the daemon falls back to the member NULL checking it was
doing before.

So, action required: NONE (I've patched all your backends to use NULL
for the get_roles action, thus falling back to what we had before)

If you want to use the new functionality to enable/disable methods,
it's up to you.

Richard.



More information about the PackageKit mailing list