[packagekit] Backend API Thought.

Tim Lauridsen tla at rasmil.dk
Fri Oct 26 06:49:31 PDT 2007


Richard Hughes wrote:
> 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 :-)
>   
The problem is in yum you have dynamic Category/Groups defined in a 
comps.xml file loaded from the repositories.
The comps files from different repos is joined into one category/group tree.

Category1
    Group1
    Group2
Category2
   Group3
   Group4

The Category/Group contains a id and a descriptive name and a translated 
names & decriptions all stored in the comps.xml files.
These can not easily, be mapped to the enumerated groups used by packagekit.
There translation is done in the comps files, so the backend dont need 
to that translation, it just passes on the translation

Tim
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/packagekit/attachments/20071026/09007a7b/attachment-0003.htm>


More information about the PackageKit mailing list