| 1 |
#!/bin/ksh |
| 2 |
# |
| 3 |
# SpecialRdist -- specially rdist lsof 4.x sources to a specified destination |
| 4 |
# |
| 5 |
# Usage: GenericRdist <destination> <dialect> <shell> |
| 6 |
# |
| 7 |
# <destination> destination host |
| 8 |
# |
| 9 |
# <dialect> dialect subdirectory name |
| 10 |
# |
| 11 |
# <shell> remote shell -- rsh or ssh |
| 12 |
|
| 13 |
# Process arguments. |
| 14 |
|
| 15 |
if test $# -ne 3 |
| 16 |
then |
| 17 |
echo "Usage: <destination> <dialect> <shell>" |
| 18 |
exit |
| 19 |
fi |
| 20 |
H=$1 |
| 21 |
D=$2 |
| 22 |
S=$3 |
| 23 |
|
| 24 |
# Test the shell and define its full path, as required. |
| 25 |
|
| 26 |
if test "X$S" = "Xrsh" |
| 27 |
then |
| 28 |
SHP="" |
| 29 |
else |
| 30 |
if test "X$S" = "Xssh" |
| 31 |
then |
| 32 |
SHP="-P /opt/openssh/bin/ssh" |
| 33 |
else |
| 34 |
echo "$S is not an acceptable shell; specify rsh or ssh." |
| 35 |
exit |
| 36 |
fi |
| 37 |
fi |
| 38 |
|
| 39 |
# Define the distfile and make sure it's removed on premature exit. |
| 40 |
|
| 41 |
R=/tmp/distfile.$$ |
| 42 |
trap 'rm $R; exit 1' 1 2 3 15 |
| 43 |
|
| 44 |
rm -f $R |
| 45 |
echo ". -> $H" > $R |
| 46 |
echo " except ( ./.ck00MAN );" >> $R |
| 47 |
echo " except ( ./.neverCust ./.neverInv );" >> $R |
| 48 |
echo " except ( ./Makefile ./ddev.c ./dfile.c ./dlsof.h ./dmnt.c );" >> $R |
| 49 |
echo " except ( ./dnode.c ./dnode1.c ./dproc.c ./dproto.h ./dsock.c );" >> $R |
| 50 |
echo " except ( ./dstore.c ./lib/Makefile ./lib/RCS ./lib/OLD ./lib/NEW );" >> $R |
| 51 |
echo " except ( ./lsof ./machine.h ./version.h ./zipme );" >> $R |
| 52 |
echo " except ( ./NEW ./OLD ./RCS ./dialects ./support ) ;" >> $R |
| 53 |
echo " except ( ./new ./old ./X ./xxx ./errs ) ;" >> $R |
| 54 |
echo " except ( ./scripts/OLD ./scripts/NEW ./scripts/RCS ) ;" >> $R |
| 55 |
echo " except ( ./scripts/00MANIFEST ./scripts/00README ) ;" >> $R |
| 56 |
echo " except ( ./tests/OLD ./tests/NEW ./tests/RCS ) ;" >> $R |
| 57 |
echo " except ( ./tests/00README ) ;" >> $R |
| 58 |
echo " except ( ./tests/LTbasic ./tests/LTbigf ./tests/LTdnlc ) ;" >> $R |
| 59 |
echo " except ( ./tests/LTlock ./tests/LTnfs ./tests/LTnlink ) ;" >> $R |
| 60 |
echo " except ( ./tests/LTsock ./tests/LTszoff ./tests/LTunix ) ;" >> $R |
| 61 |
echo " except_pat ( \\\\./tests/config\\\\. );" >> $R |
| 62 |
echo " except_pat ( \\\\.gz \\\\.o \\\\.a );" >> $R |
| 63 |
echo " install src/lsof4 ;" >> $R |
| 64 |
echo "" >> $R |
| 65 |
echo "./dialects/$D -> $H" >> $R |
| 66 |
echo " except ( ./dialects/$D/NEW );" >> $R |
| 67 |
echo " except ( ./dialects/$D/OLD ./dialects/$D/RCS );" >> $R |
| 68 |
echo " install src/lsof4/dialects/$D ;" >> $R |
| 69 |
|
| 70 |
# Do the actual distribution. |
| 71 |
|
| 72 |
(cd $HOME/src/lsof4; rdist $SHP -f $R) |
| 73 |
rm $R |
| 74 |
echo done |