On Tue, Jun 16, 2009 at 09:57:08AM -0700, Danek Duvall wrote:
> On Tue, Jun 16, 2009 at 11:39:37AM -0500, Nicolas Williams wrote:
> 
> > > Besides, I'm not sure if I really want to have "install -n[v]" be
> > > parseable.
> > 
> > Huh?
> 
> If "pkg install -n" were to tell you that a reboot would be required (as
> Venky had mentioned earlier), then in order to use that in a script, the
> output of the command would need to be Committed, hence parseable in some
> form.  If all you care about is human-readable messaging, then I don't see
> any problems with it.

A well-defined exit status code will do.

pkg install -n foo > $tmpfile 2>&1

case $? in
        # Done!
        0) : ;;
        # Reboot required, tell the user/do whatever, try again
        $IPS_REBOOT_REQD) ...;;
        # Oops, something went wrong, show the user pkg's output, ...
        *) ...;;
esac

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

Reply via email to