#!/bin/ksh # Checks out specified baseline WEPS projects # with their "currrent" WEPS run directory USAGE0="Usage: `basename $0` proj_dir proj_dir proj_dir ..." USAGE1=" proj_dir WEPS project dir with ext." # echo "before getopts loop, command line has: $*" # Extract any commandline args and options, if any while getopts "?" c do case $c in u) : ;; # Do nothing - we can't define NEW_PROJ c) NEW_PROJ=1 ;; o) OARG=$OPTARG ;; \?) echo "$USAGE0" 1>&2 echo "$USAGE1" 1>&2 exit 2 ;; esac done shift `expr $OPTIND - 1` # echo "after getopts loop, command line has: $*" # echo "NEW_PROJ=$NEW_PROJ : OARG=$OARG : Files are $*" # echo "$0 : $1 : $2 : $3 : $4" #--------------------------------------------------------------------- # Obtain WEPS "Project" and "Run" directory names (with extensions) proj_name=../weps1.baselines/$1 # run_name=`basename $1` # Specify the default "current" Run directory basename cur_name="current.wjr" # WEPS "Project" and "Run" directory extensions proj_ext=".wpj" run_ext=".wjr" # Might be nice to ensure that the specified project and run names have the correct extensions # echo "$proj_name : $run_name : $cur_name" #--------------------------------------------------------------------- # We need to check for existance of these directories #--------------------------------------------------------------------- base_dir=weps1.baselines cur_run=current.wjr cdir=`dirs` # echo "Current path: ${cdir} " if [ ${base_dir} = `basename ${cdir}` ] then : # echo "matches" else echo "Current directory is not ${base_dir}" exit 1 fi cd .. ndir=`dirs` # echo "New path: ${ndir} " for file in $* do # echo "File is: ${file}" cvs co -l ${base_dir}/${file} ${base_dir}/${file}/${cur_run} done