johan...@sun.com wrote:
On Tue, Aug 18, 2009 at 01:23:23PM -0700, Brock Pytlik wrote:
johan...@sun.com wrote:
Brock,

On Mon, Aug 17, 2009 at 08:31:35PM -0700, Brock Pytlik wrote:
http://cr.opensolaris.org/~bpytlik/ips-10515-v1/

10515 search should support -o for output like pkg contents
10608 search should support -H option for output
Meta-comments from me this time.

I'm concerned about our use of valid_special_attrs, and related lists.
In general, it would be nice if we could filter on package attributes as
actions add them, without having to write code to do so.
I'm confused by your comment. If you want to output the mode of an file action, you do -o mode, and everything works. The special attributes are ones that do not have a one-to-one mapping with attributes of an action.

So what about pkg.size and pkg.csize?  These ought to be covered, since
they're existing attributes of an action; however, we have special
mappings for them here.

For everyone following along, J and I talked offline and we came to this conclusion: The problem is that we've got conflicting namespaces. Specifically, the code says that attributes that start with "action.", "pkg." and "search." belong to the space of pseudo attributes which are known and synthesized within the code. However, we've tagged actions with two attributes that start with "pkg." (pkg.csize and pkg.size). So these are not pseudo attributes, but actual attributes on an action.

We think there are two reasonable paths forward. One is to continue to reserve pkg. as a namespace for psuedo attributes and treat pkg.csize and pkg.size as exceptions we won't make again (and possibly correct them to be just csize and size sometime in the future). The other is to declare that while some pkg. attributes are pseudo attributes (like pkg.name, pkg.fmri) others are real attributes, and therefore we will no longer check the correctness of the "pkg." fields in given as arguments to the -o options.

As a side note, currently you can't get the pkg.summary attribute out from either contents or search because of this same issue.

Personally, I think the second is the saner way to go. The danger with that approach is that if a user mistypes a -o argument to contents, they'll simply get no output, instead of the warning they do today. However, the same is true today if they mistype "path" as "pth" or "mode" as "moed".

Whichever we decide to go with, I think it's not this bug's job to fix it. If we converge on a decision quickly, I'm happy to roll that into this change if it's small (like removing the "pkg." check), but otherwise I think it can come in separately since this isn't changing the current behavior.

Thanks,
Brock


-j

Brock
_______________________________________________
pkg-discuss mailing list
pkg-discuss@opensolaris.org
http://mail.opensolaris.org/mailman/listinfo/pkg-discuss

Reply via email to