On 04/22/10 15:06, Bill Sommerfeld wrote:
On 04/21/10 18:16, Bart Smaalders wrote:
2) All image-modifying operations on a live image
would create a new boot environment only if needed.
This behavior could be altered via command line flags
to always create a new boot environment or to never
create one, failing instead if the operation needs
one.
How do I know what happened in this case? in particular, how would a
script invoking a "pkg install"'s know which path was taken?
How would I do the equivalent of:
pkg install foo
if last-pkg-op-created-new-be; then
schedule-a-reboot
else
restart-a-few-things
fi
Well, I can add an exit status, but the last time I did that
I broke lots of people's shell scripts. Actually, since
pkg install would fail today if it needed to create a new
BE, I prob. won't cause too many problems ;-).
The inefficient approach as I proposed this would be:
pkg install --no-new-be foo
if $? == 0:
restart-a-few-things
elif $? == 4:
#do-nothing - best version already installed
elif $? == 5:
pkg install --always-new-be foo foo
if $? == 0:
schedule-a-reboot
else:
handle-other-errors
else:
handle-other-errors
I'll mull this over...
???
Also, does -R imply --no-new-be ?
Yes, as it does today; pkg -R ... image-update will not
create a new BE.
- Bart
--
Bart Smaalders Solaris Kernel Performance
[email protected] http://blogs.sun.com/barts
"You will contribute more with mercurial than with thunderbird."
_______________________________________________
pkg-discuss mailing list
[email protected]
http://mail.opensolaris.org/mailman/listinfo/pkg-discuss