[packagekit] Backend API Thought.

Richard Hughes hughsient at gmail.com
Fri Oct 26 06:29:16 PDT 2007


On Fri, 2007-10-26 at 15:23 +0200, Tim Lauridsen wrote:
> I have done a little thinking about what could be useful to have in the 
> packagekit backend API.
> 
> * get-group-list : Get a list groups found in the repositories.
> To make it possible to make dynamic group view in a frontend client.
> (search-group should be used to get the packages in the groups)
> signals:

We already have this; see backend_get_groups:

/**
 * backend_get_groups:
 */
static void
backend_get_groups (PkBackend *backend, PkEnumList *elist)
{
        g_return_if_fail (backend != NULL);
        pk_enum_list_append_multiple (elist,
                                      PK_GROUP_ENUM_ACCESSIBILITY,
                                      PK_GROUP_ENUM_GAMES,
                                      PK_GROUP_ENUM_SYSTEM,
                                      -1);
}

> group<tab>categoryid;groupid<tab>translated categoryname;translated 
> groupname<tab>translated group describtion

We can't have any translations done by the daemon, they all have to be
enumerated types - the daemon has to be C locale, and the client
converts the enums to localised text. It's the same as what we do with
errors.

> examples:
> group<tab>application;editors<tab>Application;Editors<tab>"Sometimes 
> called text editors, these are programs that allow you to create and 
> edit files. These include Emacs and Vi."

The translations can be done in pk-common-gui.c in gnome-packagekit - we
can add as many translations and enumerated values there are you like. I
don't mind making the translators work harder :-)

> *install-group/remove-group <groupid>
> Install/remove group
> *get-packages<filter> : get list of packages
> filter could be installed, available, recent (newly updated/added 
> available packages), extras (packages install but not found in repo)
> This could be used if someone will make package manager gui the show all 
> installed/available packages (yumex, pirut, synaptic etc)

If you implement a backend_search_group method, then the
backend_get_groups code is used to show a list in pk-application. If you
click this list, then the members of this list are got from SearchGroup,
where you can see the installed or available status. See
http://blogs.gnome.org/kenvandine/category/packagekit/ for a screenshot.

> Comments, please and other suggestion there could be useful in tha 
> backend API.

The only thing you've done differently here to what's already in git is
have a category id and a group id, which I'm guessing lets you have
categories like "editors" and groups like "gtk" -- I think apt is unique
in that regard. Suggestions on how to improve the interface accepted :-)

Richard.


 




More information about the PackageKit mailing list