echo "usage: `/bin/basename $tool` -d configdir -p <processor> [-l|-v <version>] [-f] <installdir>"
echo " -d <configdir> : the location of config files"
echo " -p <processor> : get software for <processor>: n2"
echo " -l : lists all available versions"
echo " -v <version> : get version <version>"
echo " -f : force create of <installdir>"
echo " Get <version> of Solaris for <processor> and put it in directory"
echo " <installdir>. The directory <installdir> is expected to not exist."
echo " Use -f if the <installdir> already exists."
echo " Use -l to see the available Solaris versions for processor."
# Where we keep all the images for solaris
# that are and have known to work.
while getopts d
:hp
:lv
:f OPT
; do
configdir
="$configdir $OPTARG"
processor
="$processor $OPTARG"
version
="$version $OPTARG"
shift `/bin/expr $OPTIND - 1`
# make sure we have config files' location
if [ "`len $configdir`" != "1" ]; then
err
"I need config files' location."
# Make sure we have a processor
if [ "`len $processor`" != "1" ]; then
err
"I need exactly one -p argument."
processor
=`echo $processor`
root
=$configdir/$processor
err
"I don't have any software for this processor: $processor"
# List versions or check the passed version
l
="$l `/bin/basename $v`"
echo "Use -v with one of: $l"
if [ "`len $version`" != "1" ]; then
err
"I need exactly one version please."
if [ ! -d ${root}/$version ]; then
err
"Version '$version' is not available for $get on $processor"
# Check we have a directory to install the software
if [ "$installdir" = "" ]; then
err
"Missing directory to install $get to at end of the command line."
if [ "$force" = "0" -a -d $installdir ]; then
err
"Directory $installdir already exists, need a new directory name, or use -f."
/bin
/mkdir
-p $installdir
# create symbolic links for simulate script
/bin
/ln -s ${root}/${version}/.simulate.sh .
/bin
/ln -s ${root}/${version}/* .