[packagekit] python backend maintainers - action required

Richard Hughes hughsient at gmail.com
Wed Mar 30 10:11:09 PDT 2011


I've just merged this patch:

commit 3d740a67ba48c65bc6711bb035a96d6344925941
Author: Richard Hughes <richard at hughsie.com>
Date:   Wed Mar 30 18:00:49 2011 +0100

    Do not allow backends to output duplicate older packages when
searching with newest

    Python backends should implement _pkg_compare() rather than
_pkg_get_unique() and use
    fliter.get_package_list() rather than using filter.post_process() directly.

This basically adds the required bits to filter.py to make the
filtering work as expected and close bugs like
https://bugzilla.redhat.com/show_bug.cgi?id=585601

What this means for you is:

1) Don't call post_process() directly in the backend (although, still
implement it if you override the default one), and instead use
get_package_list()
2) Instead of implementing _pkg_get_unique(), implement _pkg_compare() instead

The latter return values are as follows:

        -2 : pkg1 not comparable with pkg2
        -1 : pkg2 is newer than pkg1
         0 : pkg1 == pkg2
         1 : pkg1 is newer than pkg2
         2 : not implemented

If you get confused, the commit for yum is
abc434a5845cf3c55bde066e003906320c277f07 which is probably worth
checking if you're not sure. The next release is the 4th April, so
there's no rush. As usual, yell if you get stuck.

Thanks,

Richard.



More information about the PackageKit mailing list