1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213
|
#!/bin/csh -f
#
# PACT-GET-PACKAGE - make a copy of some PACT package on which to work
#
# Usage: (see Help package... next page)
#
####################
# include "cpyright.h"
#
# see PCD for the reason for this
set Here = `pwd` ; cd ; set RealHome = `pwd` ; cd $Here ; unset $Here
set Code = pact
set LocDir = `pwd | sed "s|$RealHome|$home|"`
set IncDir = /usr/local/include
set HELP = "FALSE"
set CodeDir = $LocDir/$Code
set Manager = $CodeDir/manager
set CodeManager = manager
set COLog = $LocDir/checkout.log
set ConfigDir = "./"
set SITE = ""
set NONE = ""
set PkgList = ""
set AllPackages = PCKS
set PactPackage = PACTPK
set Packages = ""
# Source Control System Variables
set SCSName = CVS
set CVSROOT = ""
set SCSRepository = ""
set SRCDate = ""
#check the command line arguments
if ($#argv < 1) then
set HELP = "TRUE"
endif
while ($#argv >= 1)
if (`expr $argv[1] : "-."` == 2) then
switch ($1)
case -c:
shift
set SITE = $1
breaksw
case -d:
shift
set SCSRepository = "-d $1"
breaksw
case -f:
shift
set ConfigDir = $1
breaksw
case -h:
set HELP = "TRUE"
breaksw
default:
set HELP = "TRUE"
breaksw
endsw
shift
else
set PkgList = ($PkgList $1)
shift
endif
end
if ($HELP == "TRUE") then
echo ""
echo " Usage: pact-get-package -c <site> [-d <CVSROOT>] [-f <directory>] <package 1> ... "
echo ""
echo " Options: c - configure the environment for <site>, gets the site configuration info "
echo " from <site>.config, Note: -c <site> may be omited if a pact/manager "
echo " configured directory exists."
echo " sample <site> configs (see manager/configs.std) are:"
echo " - auto auto-configuration "
echo " - aix IBM RS6000 systems "
echo " - hp HP RISC 700 systems "
echo " - irix SGI systems "
echo " - linux LINUX systems "
echo " - meiko MEIKO solaris systems "
echo " - mips MIPS OS systems "
echo " - osf OSF systems "
echo " - solaris Sun Solaris systems "
echo " - sung Sun systems with GCC "
echo " - sun standard Sun systems "
echo " - t3d CRAY t3d systems "
echo " - ultrix DEC ULTRIX systems "
echo " - unicos CRAY UNICOS systems "
echo " (check manager/configs.local for any local configs)"
echo ""
echo " d - specify a CVSROOT instead of the environment variable"
echo " f - a directory containing configuration files"
echo " (default ...pact/manager/configs.std)"
echo ""
echo " Current packages: score - PACT Core"
echo " ppc - Portable Process Control"
echo " pml - Portable Math Library"
echo " pdb - Portable DataBase Library"
echo " scheme - Scheme Interpreter/Library"
echo " pgs - Portable Graphics System Library"
echo " panacea - Portable Numerical Simulation Support"
echo " ultra - 1D data analysis tool"
echo " sx - Scheme plus eXtenstions"
echo ""
echo " Special package options: "
echo " none - get the base PACT system with no packages"
echo " all - get the entire PACT system"
echo "Examples:"
echo " To force reconfiguration if manager changes"
echo " pact-get-package -c <site> none"
echo " To add/replace a package to an existing pact directory (No configuration)"
echo " pact-get-package ultra"
echo " To add/replace a package to an existing pact directory AND re-configure"
echo " pact-get-package -c <site> ultra"
echo ""
exit(1)
endif
if ($PkgList[1] == "") then
echo " "
echo "ERROR: PACKAGE must be selected"
echo " "
exit(1)
endif
set CheckOut = "cvs co $SCSRepository"
set GetManager = "FALSE"
set GotManager = "FALSE"
if (!(-d $CodeDir)) then
echo ""
echo "Creating the $Code directory"
mkdir $CodeDir
endif
cd $CodeDir
if (!(-d $Manager)) then
if ($SITE == "") then
echo " "
echo "ERROR: SITE must be supplied"
echo " "
exit(1)
endif
set GetManager = "TRUE"
endif
if ($PkgList[1] == "none") then
set GetManager = "TRUE"
endif
if ($GetManager == "TRUE") then
echo ""
echo "Getting the PACT Manager"
$CheckOut $CodeManager >>& $COLog
if (-d $Manager/$Code/doc/$CodeManager) then
mv $Manager/$Code/doc/$CodeManager $Manager/doc
rm -r $Manager/$Code
endif
set GotManager = "TRUE"
endif
# determine the list of packages being requested
if ($PkgList[1] == "none") then
set NONE = "none"
set Packages = `echo $NONE`
else
if ($PkgList[1] == "all") then
set Packages = `echo $AllPackages`
else
set Packages = `echo $PkgList`
endif
endif
echo ""
echo "Requested PACT packages: $Packages"
echo "Requested PACT packages: $Packages" >>& $COLog
# copy the requested packages
if ($NONE != "none") then
while ($#Packages > 0)
set pck = $Packages[1]
echo "Getting the $pck package"
echo "Getting the $pck package" >>& $COLog
$CheckOut $pck >>& $COLog
if (-d $pck/$Code/doc/$pck) then
mv $pck/$Code/doc/$pck $pck/doc
rm -r $pck/$Code
endif
shift Packages
end
endif
# change the configuration if requested
if (($GotManager == "TRUE") || ($SITE != "")) then
cd $Manager
chmod a+x pact-*
echo "Configure local copy of PACT"
./pact-config -f $ConfigDir $SITE
cd ..
endif
echo ""
exit($status)
|