On Mon, Aug 03, 2009 at 02:20:17PM +0100, Darren J Moffat wrote:

> http://cr.opensolaris.org/~darrenm/pkg/

I can't speak to the design; Dan will have to comment on that, but for the
specific problem you're trying to fix, it seems reasonable to me.

Otherwise, the change looks fine to me, though you could have simply added
the "exit 0" to the existing awk command.  Also, though you didn't
introduce this, awk will always exit 0 in this case, so the test for the
return code is useless.  You could add an "END {exit 1}" clause, though
since we're already assuming some stability of the output format, perhaps
we don't have to do that.  :)  If what we care about is the exit status of
the pkg command, then we might have to rely on ksh93's pipefail option
(though that doesn't seem to work for me the way I'd expect).

Similarly, the way get_pub_secinfo is used, the return value of the
function is meaningless.  It should really print "None None" and return on
failure, and its callers should test for that.

Another nit: there's no need for a backslash inside $().

Also, please preserve the style of the rest of the script -- no spaces
inside "{}" or before semicolons in awk, and no spaces inside the parens in
the $() constructs.

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

Reply via email to