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 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247
|
#!/bin/csh
#>
#> PACT-SEND - transport a distribution to the named host
#>
#> Usage: pact-send -d <directory> -dh <host> [-h] [-b] [-e] [-o] [-u] [-m]
#>
#> Options:
#> -d Destination directory
#> -e Export distribution for source repository only
#> -dh Destination host
#> -h Help Package
#> -m Send a MAC distribution
#> -o Omit the documents
#> -r Omit the README files
#> -u Use the distribution that is already out
#>
# Source Version: 2.0
# Software Release #92-0043
#
# include "cpyright.h"
#
unalias cd
# see PCD for the reason for this
set Here = `pwd` ; cd ; set RealHome = `pwd` ; cd $Here ; unset $Here
set Anonymous = FALSE
set PACTDir = `pwd | sed "s|$RealHome|$home|"`
set LogFile = $PACTDir/send.log
set UNIX = "TRUE"
set MAC = "FALSE"
set Dest = "FALSE"
set DestDir = "FALSE"
set Docs = "-t"
set help = "FALSE"
set GetDist = "TRUE"
set Passwd = ""
set RMFiles = "YES"
set Pattern = ""
set Export = ""
while ($#argv >= 1)
switch ($1)
case -a:
set Anonymous = TRUE
breaksw
case -d:
shift
set DestDir = $1
breaksw
case -e:
set Export = "-r"
set Pattern = "e"
breaksw
case -g:
echo -n "Password: "
stty -echo
set Passwd = $<
stty echo
echo ""
breaksw
case -dh:
shift
set Dest = $1
breaksw
case -h:
set help = TRUE
breaksw
case -m:
set MAC = "TRUE"
breaksw
case -o:
set Docs = ""
breaksw
case -r:
set RMFiles = ""
breaksw
case -u:
set GetDist = FALSE
breaksw
default:
set help = TRUE
breaksw
endsw
shift
end
if (($DestDir == "FALSE") || ($Dest == "FALSE") || ($help == "TRUE")) then
echo " "
echo "Usage: pact-send [-a] [-b] -d <directory> -dh <host> [-h] [-e] [-o] [-u] [-m]"
echo " "
echo "Options: "
echo " -a Use anonymous FTP"
echo " -d Destination directory"
echo " -e Export distribution for repository only"
echo " -dh Destination host"
echo " -h Help Package"
echo " -m Prepare a MAC distribution as well"
echo " -o Omit the documents"
echo " -r Omit the README files"
echo " -u Use the distribution that is already out"
echo " "
exit(1)
endif
# make the distribution files
cd $PACTDir
rm -f $LogFile
echo "Sending PACT distribution to $Dest (see send.log for details)"
echo "Sending PACT distribution to $Dest" > $LogFile
if ($GetDist == "TRUE") then
touch pactfoo-src
rm -f pact*-src pact*mac.tar.gz pact*doc.tar.gz pact-*README
echo "Building PACT Unix distribution (see distrib.log for details)"
echo "Building PACT Unix distribution (see distrib.log for details)" >>& $LogFile
echo "pact-dist $Docs $Export" >>& $LogFile
./pact-dist $Docs $Export >>& $LogFile
if ($status != 0) then
echo "Problem in pact-dist - Abort"
echo "Problem in pact-dist - Abort" >>& $LogFile
exit(1)
endif
if ($MAC == "TRUE") then
echo "" >>& $LogFile
echo "Building PACT MAC distribution (see distrib.log for details)"
echo "Building PACT MAC distribution (see distrib.log for details)" >>& $LogFile
echo "pact-dist -m" >>& $LogFile
./pact-dist -m >>& $LogFile
if ($status != 0) then
echo "Problem in pact-dist - Abort"
echo "Problem in pact-dist - Abort" >>& $LogFile
exit(1)
endif
endif
endif
if ($?USER == 0) then
if ($?LOGNAME == 0) then
set USER = "anonymous"
else
set USER = $LOGNAME
endif
endif
if ($Anonymous == TRUE) then
set Who = "anonymous"
set Passwd = "$USER"@`uname -n`
else
set Who = $USER
endif
# do the transfer
if ($UNIX == "TRUE") then
if ($Pattern == "") then
set Pattern = 'pact.FAQ pact*-src pact*doc.tar.gz'
else
set Pattern = 'pact*.tar.gz'
endif
if ($RMFiles == "YES") then
cp README pact-unix.README
set Pattern = ($Pattern pact-unix.README)
endif
chmod 664 $Pattern
chmod 775 pact*-src
echo "" >>& $LogFile
echo "Doing the transfer via FTP" >>& $LogFile
(echo "open $Dest" ; \
echo "user $Who $Passwd" ; \
echo "prompt" ; \
echo "bin" ; \
echo "cd $DestDir" ; \
echo "mdele $Pattern" ; \
echo "mput $Pattern" ; \
echo "quit" ) | ftp -n >>& $LogFile
echo "Transfer done" >>& $LogFile
# echo the FTP commands into the log
echo "" >>& $LogFile
echo "FTP Commands" >>& $LogFile
(echo " open $Dest" ; \
echo " user $Who xxxxx" ; \
echo " prompt" ; \
echo " bin" ; \
echo " cd $DestDir" ; \
echo " mdele $Pattern" ; \
echo " mput $Pattern" ; \
echo " quit" ) >>& $LogFile
echo "" >>& $LogFile
if ($RMFiles == "YES") then
rm pact-unix.README
endif
endif
if ($MAC == "TRUE") then
set MacPattern = 'pact.FAQ pact*mac.tar.gz pact*doc.tar.gz'
if ($RMFiles == "YES") then
cp mac/README.MAC pact-mac.README
set MacPattern = ($MacPattern pact-mac.README)
endif
chmod 664 $MacPattern
echo "" >>& $LogFile
echo "Doing the transfer" >>& $LogFile
(echo "open $Dest" ; \
echo "user $Who $Passwd" ; \
echo "prompt" ; \
echo "bin" ; \
echo "cd $DestDir" ; \
echo "mdele $MacPattern" ; \
echo "mput $MacPattern" ; \
echo "quit" ) | ftp -n >>& $LogFile
echo "Transfer done" >>& $LogFile
# echo the FTP commands into the log
echo "" >>& $LogFile
echo "FTP Commands" >>& $LogFile
(echo " open $Dest" ; \
echo " user $Who xxxxx" ; \
echo " prompt" ; \
echo " bin" ; \
echo " cd $DestDir" ; \
echo " mdele $MacPattern" ; \
echo " mput $MacPattern" ; \
echo " quit" ) >>& $LogFile
echo "" >>& $LogFile
if ($RMFiles == "YES") then
rm pact-mac.README
endif
endif
set Passwd = ""
echo "PACT distribution sent to $Dest"
echo ""
echo "PACT distribution sent to $Dest" >>& $LogFile
echo "" >>& $LogFile
exit($status)
|