One more thought, the right place to fix this is in attribute.py. I think if 'None' on line 109 was change to 'v', the correct behavior would happen. The problem with just doing this is that it requires a reindex to work correctly, which essentially means it means bumping the dictionary format. (It would also force a reindex on the client, but that's probably less of an issue. We could also discuss ways to make it work compatibly with the old version until the user does a full-reindex automatically.) Further (without a corresponding bump in the search version), a client wouldn't necessarily know whether it was talking to a server which was working from an old or new version. However, we could do a decent job making a guess (and it wouldn't be any more gross than what we'd need to do to handle the multiple value action case anyway).

Brock


Brock Pytlik wrote:
Danek Duvall wrote:
Saurabh Vyas wrote:

webrev : http://cr.opensolaris.org/~saurabhv/fix-9970/

Given the comment immediately above, it seems like what's coming back in
"match" isn't the right thing.  Is the comment wrong?

Danek
_______________________________________________
pkg-discuss mailing list
[email protected]
http://mail.opensolaris.org/mailman/listinfo/pkg-discuss
Well... it kinda depends on what "the right thing" means. What's sent back in 'match' is the token which matched the search query. Generally, this is what you want (I think), but with something like a description, an argument can be made that what you really want is the entire contents of the description, not just the matching string. I think the comment should probably say something like,

For those actions, the match parameter states which token in the values matched the query.


I'm reasonably comfortable with the fix proposed as a starting point, but I have my doubts that it'd work correctly on an action like this:
set=name value=foo value=baz value=bar value="whee fun"

In this case, I'd expect 'pkg search bar' to return
description set       bar   pkg://<pkg name>

But 'pkg search fun' or 'pkg search whee' to return:
description set       whee fun   pkg://<pkg name>

Also, I'd like to see test cases added for the correct behavior.


Thanks,
Brock
_______________________________________________
pkg-discuss mailing list
[email protected]
http://mail.opensolaris.org/mailman/listinfo/pkg-discuss

_______________________________________________
pkg-discuss mailing list
[email protected]
http://mail.opensolaris.org/mailman/listinfo/pkg-discuss

Reply via email to