onu.sh.in revision 9f9230833b50b8271840dc2c12bd1e94d9df7d12
#
# CDDL HEADER START
#
# The contents of this file are subject to the terms of the
# Common Development and Distribution License (the "License").
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
# See the License for the specific language governing permissions
# and limitations under the License.
#
# When distributing Covered Code, include this CDDL HEADER in each
# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
# If applicable, add the following below this CDDL HEADER, with the
# fields enclosed by brackets "[]" replaced with your own identifying
# information: Portions Copyright [yyyy] [name of copyright owner]
#
# CDDL HEADER END
#
#
# Copyright 2010, Richard Lowe
#
export PATH
DEFAULTONPUB="on-nightly"
usage()
{
echo "usage: $0 [opts] [-s beName] -t beName"
echo "usage: $0 [opts] -r"
echo
echo "\t-c consolidation : consolidation being upgraded"
echo "\t-d repodir : directory for repositories"
echo "\t-r : configure publisher only"
echo "\t-s : source BE to clone"
echo "\t-t : new BE name"
echo "\t-u uri : origin URI for redist repository"
echo "\t-U prefix: prefix for redist repository"
echo "\t-v : verbose"
echo "\t-Z : skip updating zones"
echo
echo "Update to an ON build:"
echo
echo "Update to the nightly build:"
echo "\tonu -t newbe"
echo
echo "Re-enable the publishers in the current BE:"
exit 1
}
{
echo $*
exit 2
}
do_cmd()
{
$*
exit_code=$?
[ $exit_code -eq 0 ] && return
# pkg(1) returns 4 if "nothing to do", which is safe to ignore
}
{
root=$1
#
# Get the publisher name from the 'list -v' output. It may seem we
# could do this more tidily using 'info', but that is
# internationalized.
#
typeset on_publisher=$(pkg -R $root list -Hv \
fi
}
update()
{
root=$1
}
{
zone=$1
return
fi
return
fi
echo "WARNING: Use of onu(1) will prevent use of zone attach in the new BE" >&2
echo "See onu(1)" >&2
fi
return
;;
esac
echo "Updating zone $name"
}
sourcebe=""
targetbe=""
uri=""
repodir=""
consolidation="osnet"
verbose=0
no_zones=0
case $i in
c)
;;
d)
;;
O) # no-op, compatibility with recommended use
;;
r)
;;
s)
;;
t)
;;
U)
;;
u)
;;
v)
verbose=1
;;
Z)
no_zones=1
;;
*)
esac
done
[ -n "$1" ] && usage
else
fi
if [ -n "$repodir" ]; then
# need an absolute path
uri="file://$redistdir"
fi
exit 0
fi
createargs=""
# ksh seems to have its own mktemp with slightly different semantics
if [ "$no_zones" != 1 ]; then
done
fi
exit 0