[packagekit] search-file pattern search

Mounir Lamouri mounir.lamouri at gmail.com
Tue Jun 23 08:35:17 PDT 2009


On Tue, Jun 23, 2009 at 4:39 PM, Richard Hughes<hughsient at gmail.com> wrote:
> On Tue, Jun 23, 2009 at 2:53 PM, Mounir Lamouri<mounir.lamouri at gmail.com> wrote:
>> I'm a bit lost in the doc/ directory.
>> Where should I add the new specification description ?
>
> It's src/org.freedesktop.PackageKit.Transaction.xml -- these
> introspection documents get parsed when we generate the docs.

Then, the patched documentation is here :
http://dev.gentoo.org/~volkmar/packagekit-searchfile-specification.patch

I was thinking we could add something in pk-transaction.c to pop an
error if search is not valid. In other words, as we assume
"/something" is an entire path and "[^/]something" is a filename. And
as far as I know, '/' is not accepted in UNIX filename, it could be
helpfull  for backends (and user if error message is clear enough) if
an error is prompted if the key doesn't begin with '/' but contains a
'/'.

Why ?
- for users: he or she can try to search foo.bar (filename) or
/etc/foo.bar and when he will try ect/foo.bar, an error will inform
him he is not allowed to search such things. Like "It is not a valid
file name".
- for backend writers: having 'key' without beginning / is great but
when it goes with comparing key with an absolut path it can be harder.
Developper can choose to compare string after last '/' from absolut
path with key or check if end of the path match the key. It will
depends but if he knows the key will be without any / it will, maybe,
be helpfull.

In two worlds:
If foo/bar can't produce any result, better to tell the user it's
invalid than tell the user nothing has been found.

Another time, i'm ok to write the needed patch if the feature is accepted.

Thanks,
Mounir



More information about the PackageKit mailing list