[packagekit] search-file pattern search
Adrien Bustany
madcat at mymadcat.com
Tue Jun 23 05:51:35 PDT 2009
On 23/06/09 13:09, Richard Hughes wrote:
> On Tue, Jun 23, 2009 at 10:57 AM, Mounir
> Lamouri<mounir.lamouri at gmail.com> wrote:
>
>> Now, according to yum backend and specifications, key represents the
>> entire path. So, if I want to search which package own myfile.foo i
>> will have to enter /bar/myfile.foo. A bit hard as I only want to
>> search for a file, not a path. We have room to put a lot of results so
>> even if the file is present in various packages, it will not be so
>> hard to see which one was the good candidate.
>>
> Hmm. I originally specified the original path for speed -- most of the
> consumers of this api just want to know "what package owns this file"
> rather than "find the package that contains this filename".
>
>
>> So, I would like to use the key in the search-file for portage backend
>> as the entire file name without the path and I would like to know if
>> this way of doing can be generalized or, at least, officialy accepted.
>> I don't want portage backend to be the only one using search-file like
>> this but I really think it's much more user-friendly. Maybe we could
>> even accept the two ways of doing to be retro-compatible.
>>
> Yes, the API would have to be backwards compatible, but this is pretty
> easy to accomplish:
>
> SearchFile("/path/to/file.conf") = absolute path
> SearchFile("file.conf") = ignore path
>
As far as I know, yum whatprovides supports wildcards... So you could
ask SearchFile ("*/yum.conf")... But maybe it's not the case for all
backends
> If you want to support the latter in your backend, then I urge you to
> also support the absolute path variant (starting with slash), else
> some of the GUI tools are going to get very confused. If we add this
> as a spec extension, it's important to add this to the spec xml
> documentation so other backends can all do the same thing.
>
> Otherwise, keep up the good work.
>
> Richard.
> _______________________________________________
> PackageKit mailing list
> PackageKit at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/packagekit
>
>
More information about the PackageKit
mailing list