[packagekit] PkExtra is dead, long live PkDesktop!

Richard Hughes hughsient at gmail.com
Wed Nov 19 08:08:09 PST 2008


I'm replacing the PkExtra GObject with PkDesktop in the Glib library.
The only thing this will affect is gnome-packagekit.

PkExtra was a complex cache helper, with a local sqlite database and the
module was used by both server and client. It's design was bad and
evolved over time to be pretty crazy. It was also impossible to wrap for
QT. We needed something more powerful and less insane.

PkDesktop provides three new client API calls:

gboolean	 pk_desktop_open_database		(PkDesktop	*desktop,
							 GError		**error);
GPtrArray	*pk_desktop_get_files_for_package	(PkDesktop	*desktop,
							 const gchar	*package,
							 GError		**error);
gchar		*pk_desktop_get_package_for_file	(PkDesktop	*desktop,
							 const gchar	*filename,
							 GError		**error);

This allows client programs to get the full association data between
desktop files and packages in a cache maintained by the daemon. It's
cached, as it needs to be non-blocking and quick.

This lets us do cool stuff like:

* Choose the _correct_ icon in client tools with weighting
* Allows us to show all the _applications_ when we search for a package
* Allows us to remove a package from a desktop file location, for
instance like the mint menubar
* Wrap the three api calls in python and QT.
* Design a tool to remove _applications_, not packages

Internally, md5 is used to check the files when doing a RefreshCache,
and the files are also added as a post-inst action when installing.

If anybody needs a hand wrapping it, or converting out-of-tree sekrit
projects from PkExtra to PkDesktop, yell. I would be surprised if this
was true, as PkExtra was such a monster.

When I've finished writing the self tests, I'll commit it to trunk.

Richard.





More information about the PackageKit mailing list