[packagekit] filters usage in get-depends / get-requires and install-packages (was: get-depends and get-requires probably shouldn't use an array of package_ids)

Mounir Lamouri mounir.lamouri at gmail.com
Fri Jul 10 01:37:08 PDT 2009


On Thu, Jul 9, 2009 at 9:21 PM, Richard Hughes<hughsient at gmail.com> wrote:
> 2009/7/8 Mounir Lamouri <mounir.lamouri at gmail.com>:
>> By the way, I'm wondering how filters should be used for these
>> functions : i understand how installed should be used but newest and
>> others... ?
>
> I guess use a generic filter function. It's quite useful to display a
> to the user a sane list of requires and depends, so we might want to
> filter on newest, gui, etc for the list.

So you are saying if I use filter=installed;~free;newest, showed
packages should be only installed, non-free and newest. If they are
not, they are not shown ? Seems weird to me.

For installed/not installed could be used to know what depends i need
to install / i have. We probably have the same opinion for this one.

But, newest is to see only newest depends ?
I think there are two possible behaviours: newest will show only
nevest packages from the list or it will force the function to get
newest ones.
Let me explain myself:
foo needs, a >= 1.0 and b >= 2.0
I have a-1.1 and b-2.0 installed and a-1.5 is available (but not installed)
With newest enabled, we can consider two behaviour:
- a-1.0 and b-2.0 is generated and a-1.0 is filtered
- a-1.1 and b-2.0 is generated and showed because newest have forced a
to be updated

For free, gui, application and others filters, it's quite the same. We
can consider the filter as only filtering results: if a is not free,
it will not be shown. Or it could block / generate an error.
For example, if I've filter=free and I try to install foo which
depends on non-free a, it will throw an error. I like this solution
for free but it looks weird for gui/application. Probably it could be
backend specific.

Finally, I have a generic function filtering a list of packages
depending on filters but I think for depends/requires/install(/etc.)
it could be more complex.
I even think it's very bad for the user. If I have filter=free;newest
and because of that, when I want to install foo package it is only
showing half of packages that are going to be installed, I think it's
confusing...

Thanks,
Mounir



More information about the PackageKit mailing list