Danek Duvall wrote:
On Thu, Aug 06, 2009 at 11:19:51AM -0700, Danek Duvall wrote:
http://cr.opensolaris.org/~dduvall/pkg-contents-match/
I've updated the webrev to include man page and usage message changes, as
well as a couple of tests. I think it's ready to go, if folks want to give
it a look-see.
Thanks,
Danek
_______________________________________________
pkg-discuss mailing list
[email protected]
http://mail.opensolaris.org/mailman/listinfo/pkg-discuss
client.py:
1567: any reason not to move this import to the top?
1568: so... there's probably no real reason to do this optimization, but
I thought I'd throw it out there since it occurred to me...
return reduce(lambda (attrval, match), y: y or fnmatch.fnmatch(attrval, match),
(
(attrval, match)
for attr in iset
for match in attr_match[attr]
for attrval in action.attrlist(attr)
), False)
Would save calls to fnmatch once a match has been found. With this
structure, I don't think there's a way to avoid the list walking once a
match has been found. Personally, I think I'd find a structure of 'for
x... for y... for z... if fnmatch(y,z): return True' clearer, but I
don't object to this if you like it this way.
Other than that, LGTM.
Brock
_______________________________________________
pkg-discuss mailing list
[email protected]
http://mail.opensolaris.org/mailman/listinfo/pkg-discuss