[packagekit] Anjuta and PackageKit

Richard Hughes hughsient at gmail.com
Wed Oct 29 01:41:27 PDT 2008


On Wed, 2008-10-29 at 11:47 +0530, Debarshi Ray wrote:
> I had earlier read Richard's mail about how he wanted PackageKit to be
> able to grab "recommended" dependencies of a package like
> plugins/codecs for a particular file format, and came to know that
> Totem has worked on such solution recently. I would like Anjuta to
> support something similar too.

It's not totem specific, it works for any application using GStreamer.

> The problem is that when a user wants to create a new project using
> Anjuta he gets some options. eg., Gtk project, Gtkmm project, PyGtk
> project, simple C/C++ project, X project, etc.. If the user wants to
> start a Gtkmm project and does not have the necessary -devel or -dev
> packages, things do not work [1]. I also do not want to take the
> extreme stand of having Anjuta have all these libraries and headers in
> its dependency chain. That will simply bloat the dependency chain and
> waste bandwidth and space.

Right, this is exactly the sort of thing that you should use PackageKit
for. At the moment projects like Abiword want to make PackageKit
download dictionaries of the correct language, without depending on all
locales.

> Right now, I am only the Fedora packager of Anjuta and a few of its
> dependencies. So where should I start if I were to work on something
> like this.

Well, you've got an initial big choice:

* session helper
* system core

The first gives you a nice fire and forget interface like

/* execute sync method */
ret = dbus_g_proxy_call (proxy, "InstallPackageName", &error,
			 G_TYPE_UINT, xid, /* window xid, 0 for none */
			 G_TYPE_UINT, timestamp, /* action timestamp, 0 for unknown */
			 G_TYPE_STRING, "pygtk-devel",
			 G_TYPE_INVALID, G_TYPE_INVALID);

This pops up a window a bit like this:
http://packagekit.org/img/gpk-client-codecs.png where the user is asked
to confirm the action, and then agree to any EULA or GPG signing
questions. When the software is installed, we return TRUE, else you get
return FALSE and a nice error code and description.

The big issue is that you need to have gnome-packagekit installed, as
KPackageKit hasn't (yet) implemented the session DBUS API.

If you want full control of the install process, i.e. to handle the
progress bars, the EULA confirmation or just want more control than what
the session interface gives you then you can use the system interface.
For your context, I would avoid doing this, as the session interface is
so much simpler.

There's tons more docs and example code here:
http://packagekit.org/pk-faq.html#session-system

> Is there some documentation about how it was done for
> Totem? With some basic idea, I can propose a concrete plan to the
> Anjuta developers and then take it from there.

I really think you just need to use the drop in code from
http://packagekit.org/files/session.c and drop the hard deps on stuff
like pygtk.

We can change or add to the session interface if for instance you want
to install more than one package at a time.

Richard.





More information about the PackageKit mailing list