1#!/bin/csh
2#
3# csh script to checkout OPT++
4#
5# Usage:   checkout_script.csh root_directory base_directory optpp-version
6# Example: checkout_script.csh /home/pwillia/regress_tests
7#                   /home/pwillia/regress_tests/test_linux head
8
9#read in arguments from the command line to use for checkouts
10set ROOT = $1 # root directory, e.g. /home/pwillia/regress_tests
11set BASE = $2 # base directory for builds, e.g. $ROOT/test_linux/
12set DV   = $3 # OPT++ Version
13set SQA  = $ROOT/OPT++/bin # sqa directory for script access
14set CVSROOT = /var/cvs
15
16# if base directory does not exist, create
17if (-e $BASE) then
18  echo "Base directory is $BASE"
19else
20  mkdir -p $BASE
21  echo "Creating base directory $BASE"
22endif
23
24# Clean up previous checkouts
25cd $BASE
26if (-e OPT++) then # if OPT++ exist, remove it
27  \rm -rf OPT++
28endif
29
30# Get the correct version of OPT++
31if ($DV == 'head' || $DV == '') then
32  echo "Checkout head version of OPT++"
33  cvs co -P OPT++
34else if ($DV == 'none') then
35  echo "Bypass OPT++ checkout"
36else
37  echo "Checkout OPT++ -r $DV"
38  cvs co -P -r $DV OPT++
39endif
40
41echo "Checkout Process Complete"
42