[packagekit] Changing the Package signal

Tim Lauridsen tla at rasmil.dk
Mon Oct 1 00:24:11 PDT 2007


Richard Hughes wrote:
> >From TODO: convert the magic number in Package to a string type
>
> I've just committed to master a change in the callback of Signal. The
> old callback relied on a magic number to mean different things for
> different situations, and was very fragile and against the spirit of the
> dbus interface as it was not self documenting.
>
> The new callback is exactly the same, but uses enumerated types. You can
> see what I mean looking at the commit
> 50f55e02c2bd35a39b5425f08eec2e5d94223606 - basically the compiled
> backends just use PK_INFO_ENUM_INSTALLED rather than "1" and the helper
> backends now have to return "available" rather than "0".
>
> I've converted the compiled backends (still, probably a good idea to
> check) and had a stab at the yum backend (probably wrong) - I've not
> touched the conary backend as it looked more complicated. It will
> probably take about 2 minutes to convert this - sorry - my python skills
> are very limited.
>
> So basically, the old mapping to new mapping is thus:
>
> When searching:
> 1	installed	PK_INFO_ENUM_INSTALLED
> 0	available	PK_INFO_ENUM_AVAILABLE
>
> When getting updates:
> 0	normal		PK_INFO_ENUM_NORMAL
> 1	security	PK_INFO_ENUM_SECURITY
> 2	important	PK_INFO_ENUM_IMPORTANT
> 3	low		PK_INFO_ENUM_LOW
>
> When processing packages:
> 0	downloading	PK_INFO_ENUM_DOWNLOADING
> 1	installing	PK_INFO_ENUM_INSTALLING
> x	removing	PK_INFO_ENUM_REMOVING
>
> Ken/Elliot - can you yell when you've made the few changes to the conary
> backend, and also Tim/Whoever for the yum backend. You can use the
> INFO_* defines I've added in packagekit.py. When these are done I'll
> push to fd.o.
>
> Thanks,
>
> Richard.
>
> p.s. this is hopefully the last API change before 0.1.0 - there will be
> one more signal added, but nothing that requires backend changes.
>
>
> _______________________________________________
> PackageKit mailing list
> PackageKit at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/packagekit
>   
I have changed the yum backend to use the new signals.

Tim



More information about the PackageKit mailing list