[packagekit] New features (read: Richard is breaking the backends again)

Richard Hughes hughsient at gmail.com
Wed May 7 07:10:55 PDT 2008


In line with the planned features for 0.2.1 [1] we'll be changing some
methods to let us do some cool new stuff in the client tools:

InstallPackage(s)  ->   InstallPackages(as)
RemovePackage(s)   ->   RemovePackages(as)
InstallFile(s)     ->   InstallFiles(as)

This means that each of these methods will be sent a string array
(char**) rather than a string (char*) - so you will have to modify your
backend to either:

* pass the strv to the underlying library and do those actions all at
once (clever library)

* iterate on all the objects processing each one (simple library)

The later can be done trivially using:

guint i;
guint length;
gchar *package_id;
length = g_strv_length (package_ids);
for (i=0; i<length; i++) {
    package_id = package_ids[i];
    install_a_single_file_like_normal (package_id)
}

I'll be merging the new code this afternoon, and then we can fix the
breakage over the next week or so. Apologies to the QPackageKit and KDE
guys, but it should be a fairly small change. Yell if you have any
questions.

Richard.

[1] http://www.packagekit.org/pk-help.html




More information about the PackageKit mailing list