[packagekit] backend 0.4.x and 0.5.x compatibility

Richard Hughes hughsient at gmail.com
Thu Aug 27 00:48:29 PDT 2009


2009/8/27 Aşkın Yollu <askin at askin.ws>:
> hi,
> I develop pisi backend on 0.4.9. I want backend is compatible with
> 0.5.x. But i have some problem.

Right, you have to understand that in 0.5.x versions we're using a new
security framework (PolicyKit1, rather than PolicyKit) which allows us
to do some cool things, but also means the methods have to be more
secure.

See http://www.packagekit.org/gtk-doc/introduction-ideas-transactions.html#introduction-ideas-transactions-trusted
for how the trusted parameter is supposed to be used.

> Some  functions definition different between 0.4.9 and 0.5.x, so i get
> incompatible pointer type error
>
> example:
> void            (*install_packages)             (PkBackend      *backend,
>                                                         gchar          **package_ids);
>
> void            (*install_packages)             (PkBackend      *backend,
>                                                         gboolean        only_trusted,
>                                                         gchar          **package_ids);
>
> how can i write compatible backend between 0.4.9 and 0.5.x?

I don't think you can -- well, you could fudge it and share a common file with:

#if PK_CHECK_VERSION(0,5,0)

around the only_trusted stuff. By that's a bit of a bodge.

See http://lists.freedesktop.org/archives/packagekit/2008-April/002919.html
for the rationalle about why we introduced only_trusted and about why
it's so important.

Richard.



More information about the PackageKit mailing list