[packagekit] filtering out old versions

Richard Hughes hughsient at gmail.com
Wed Mar 30 02:18:57 PDT 2011


I'm again looking at an old bug that's hard to fix:

https://bugzilla.redhat.com/show_bug.cgi?id=585601

Basically, the user (or program) does a search for all not-installed
versions of a package, to see if there is a package available. So we
have:

installed:

test-0.2

available:

test-0.1
test-0.2

So when we do SearchName("~installed;newest", "test") we get back:

installed test-0.2 (this is filtered out due to ~installed, or never
added for some backends)
available test-0.1
available test-0.2 (this is filtered out as it's the same as the
installed version)

So we return available test-0.1, which isn't possible to use as
PackageKit doesn't support downgrades and is misleading to the user as
it looks like the package isn't installed.

So, the obvious fix is to fix how we do the filtering of "same as the
installed version" to "newer than the installed version"

Then we have a problem:

* We need to add the installed packages to the results array and
filter them out again in post_filter, even when the user has specified
~installed. At least for zif, that overhead isn't large, but for yum
it can double the execution time of some queries.

So, some things I wanted to sanity check with everyone before I made changes:

* We agree PackageKit isn't capable of package downgrades (otherwise
we have to add yet another filter to control the results...)
* We agree that adding (or checking) search matches for installed
packages is a sane thing to do from an efficiency point of view

Ideas welcome,

Richard


More information about the PackageKit mailing list