[packagekit] Resolve function specification

Richard Hughes hughsient at gmail.com
Mon Jun 29 02:43:36 PDT 2009


On Sun, Jun 28, 2009 at 11:04 PM, Mounir
Lamouri<mounir.lamouri at gmail.com> wrote:
> Still me with specifications. Sorry for bothering and spamming everybody but I
> think it's needed to make things clearer.

No, it's great you're doing things properly, please don't apologise.

> First of all, yum backend is considering the input as a list, not a single
> package id.

I don't think there are any users of Resolve(list) -- I think they all
only pass one thing. I think the idea for multiple terms was to do an
OR search, although in hindsight, there should be a string passed, not
a string list.

> Next, yum backend has a special behaviour. It looks like "newest" is always enabled.

That looks like a leftover part of DNA from the start of the project
(before we had filters). I'm sure we want to compare the same EVR (see
below) but certainly not the pkg.EVR < instpo.EVR part. I'll remove
that bit now. It also looks like yum's resolve doesn't do any
filtering apart from installed. I'll fix that too.

> Finally, this function is even more difficult to manage because specification
> doesn't tell how it's used. Everybody will understand Search* functions are for
> users and most functions use cases are clear. This one is clearly internal but
> how exactly. It will help for backend choices and probably will help to
> understand yum backend choices.

Right, I see from a 40,000ft view of how the API operates:

SearchName(power) matches gnome-power-manager and powerman
SearchDetails(power) matches stuff with power in the description or
summary, or licence, etc
Resolve(power) only matches packages exactly matching, so a package
matching power.

And then we specify filters such as newest, ~installed and that sort
of thing to narrow down search results.

>From an implementation point of view, I don't think Resolve is any
different from SearchFoo, without the wildcarding.

There's one thing I'm not sure about resolve, is whether to return the
original package. e.g.

if I have installed dave-002, and there is dave-003 in one repo, and
dave-002 in another, and I do Resolve(dave, FILTER_NONE) should I get:

installed dave-002
available dave-002
available dave-003

or:

installed dave-002
available dave-003

I think the second makes most sense. Might be good to put an example
in the docs.

Richard.



More information about the PackageKit mailing list