Newsgroups: comp.sources.unix From: ram@eiffel.com (Raphael Manfredi) Subject: v25i102: kit - the ultimate mailing kit, Patch12 Sender: sources-moderator@pa.dec.com Approved: vixie@pa.dec.com Submitted-By: ram@eiffel.com (Raphael Manfredi) Posting-Number: Volume 25, Issue 102 Archive-Name: kit/pch12 [The latest patch for kit version 2.0 is #12. ram@eiffel.com (Raphael Manfredi) ] System: kit version 2.0 Patch #: 12 Priority: LOW Subject: patch #11, continued Date: Sat Jan 11 19:32:09 PST 1992 From: Raphael Manfredi Description: See patch #11. Fix: From rn, say "| patch -p -N -d DIR", where DIR is your kit source directory. Outside of rn, say "cd DIR; patch -p -N If you send a mail message of the following form it will greatly speed processing: Subject: Command @SH mailpatch PATH kit 2.0 LIST ^ note the c where PATH is a return path FROM ME TO YOU either in Internet notation, or in bang notation from some well-known host, and LIST is the number of one or more patches you need, separated by spaces, commas, and/or hyphens. Saying 35- says everything from 35 to the end. To get some more detailed instructions, send me the following mail: Subject: Command @SH mailhelp PATH Index: patchlevel.h Prereq: 11 2c2 < #define PATCHLEVEL 11 --- > #define PATCHLEVEL 12 Index: badtar/badtar.SH *** badtar/badtar.SH.old Sat Jan 11 19:24:20 1992 --- badtar/badtar.SH Sat Jan 11 19:24:21 1992 *************** *** 0 **** --- 1,125 ---- + case $CONFIG in + '') + if test ! -f config.sh; then + ln ../config.sh . || \ + ln ../../config.sh . || \ + ln ../../../config.sh . || \ + (echo "Can't find config.sh."; exit 1) + fi 2>/dev/null + . config.sh + ;; + esac + case "$0" in + */*) cd `expr X$0 : 'X\(.*\)/'` ;; + esac + echo "Extracting man/badtar.$manext (with variable substitutions)" + $rm -f badtar.$manext + $spitshell >badtar.$manext <. + .br + Extended by Raphael Manfredi . + .br + .sp + \fIBadtar\fR was enhanced at Interactive Software Engineering Inc, Santa + Barbara, USA. + !GROK!THIS! + chmod 444 badtar.$manext Index: kit/unkit.SH Prereq: 2.0.1.7 *** kit/unkit.SH.old Sat Jan 11 19:24:49 1992 --- kit/unkit.SH Sat Jan 11 19:24:50 1992 *************** *** 19,27 **** # @(#) (c) E. Mogenet April 1990 # @(#) (c) R. Manfredi, 1990 1991 ! # $Id: unkit.SH,v 2.0.1.7 91/12/08 14:56:49 ram Exp $ # # $Log: unkit.SH,v $ # Revision 2.0.1.7 91/12/08 14:56:49 ram # patch10: added space in the credit for Emmanuel Mogenet # --- 19,31 ---- # @(#) (c) E. Mogenet April 1990 # @(#) (c) R. Manfredi, 1990 1991 ! # $Id: unkit.SH,v 2.0.1.8 92/01/11 19:20:05 ram Exp $ # # $Log: unkit.SH,v $ + # Revision 2.0.1.8 92/01/11 19:20:05 ram + # patch11: now knows about badtar + # patch11: added -b option to force use of badtar + # # Revision 2.0.1.7 91/12/08 14:56:49 ram # patch10: added space in the credit for Emmanuel Mogenet # *************** *** 57,73 **** pl='$PATCHLEVEL' version='$VERSION' !GROK!THIS! ! case "$d_taropt_o" in ! "$define") opt='xvof';; ! *) opt='xvf';; esac - echo "tar_opt='$opt'" >> unkit $spitshell >>unkit <<'!NO!SUBS!' decoding=hexdecode # Default decoding program preserve=yes # Preserve input files by default # In case we are interrupted, remove all the temporary files trap 'test -f zzz.minikit && rm -f `cat zzz.minikit` zzz.minikit; \ --- 61,92 ---- pl='$PATCHLEVEL' version='$VERSION' + # Tar options to be used + badtar='$needbtar' !GROK!THIS! ! case "$d_portable" in ! define) cat >> unkit </dev/null | tar -xof - >/dev/null 2>&1; then ! tar_opt='xvof' ! else ! tar_opt='xvf' ! fi ! EOP ! ;; ! *) case "$d_taropt_o" in ! "$define") opt='xvof';; ! *) opt='xvf';; ! esac ! echo "tar_opt='$opt'" >> unkit ! ;; esac $spitshell >>unkit <<'!NO!SUBS!' + decoding=hexdecode # Default decoding program preserve=yes # Preserve input files by default + usebtar='' # Do not use badtar # In case we are interrupted, remove all the temporary files trap 'test -f zzz.minikit && rm -f `cat zzz.minikit` zzz.minikit; \ *************** *** 75,81 **** # Old Bourne shells do not have functions usage=' ! echo "Usage: unkit [-hlprV] [file1 ... filen]"; echo " "" -h : give this help message."; echo " "" -l : list the contents of a the kit files."; echo " "" -p : preserve input files (default)."; --- 94,101 ---- # Old Bourne shells do not have functions usage=' ! echo "Usage: unkit [-bhlprV] [file1 ... filen]"; ! echo " "" -b : force use of badtar ($badtar by default)."; echo " "" -h : give this help message."; echo " "" -l : list the contents of a the kit files."; echo " "" -p : preserve input files (default)."; *************** *** 101,108 **** --- 121,131 ---- -l) tar_opt=tvf preserve=yes shift;; + -b) usebtar='true' + shift;; -*) echo "Unknown option $i" eval $usage;; + *) break;; esac done *************** *** 146,157 **** decoding=$decoding" | des -d -b" fi ! echo "Decoding with $decoding" cat `ls z??.[hb][ea]*.??` | eval $decoding | zcat | ! tar $tar_opt - test -f zzz.minikit && rm -f `cat zzz.minikit` zzz.minikit rm -f z??.[hb][ea]*.?? --- 169,191 ---- decoding=$decoding" | des -d -b" fi ! # Maybe we need badtar... ! case "$badtar" in ! true) tarcmd="badtar -s -o -f - | tar $tar_opt -";; ! *) if test "$usebtar"; then ! tarcmd="badtar -s -o -f - | tar $tar_opt -" ! else ! tarcmd="tar $tar_opt -" ! fi ! ;; ! esac ! ! echo "Decoding with $decoding | zcat | $tarcmd" cat `ls z??.[hb][ea]*.??` | eval $decoding | zcat | ! eval "$tarcmd" test -f zzz.minikit && rm -f `cat zzz.minikit` zzz.minikit rm -f z??.[hb][ea]*.?? Index: man/unkit.SH *** man/unkit.SH.old Sat Jan 11 19:25:05 1992 --- man/unkit.SH Sat Jan 11 19:25:05 1992 *************** *** 15,20 **** echo "Extracting man/unkit.$manext (with variable substitutions)" $rm -f unkit.$manext $spitshell >unkit.$manext <unkit.$manext </dev/null + . config.sh + ;; + esac + case "$0" in + */*) cd `expr X$0 : 'X\(.*\)/'` ;; + esac + echo "Extracting shar/rshar (with variable substitutions)" + $spitshell >rshar <>rshar <<'!NO!SUBS!' + # This is a stripped down implementation of Rich Salz's cshar. Among the + # list of features missing, no directories are ever created: rshar assumes + # the list of files to be shar'ed are listed in a single directory, which + # is the case with kit. + # It is not intended to be used directly. Rather, it is called by makeshar + # via kit when cshar is missing. + + # Default values + max=1 + number=1 + + # Option parsing + for i in $* + do + case "$i" in + -k) shift + max=$1 + shift + ;; + -n) shift + number=$1 + shift + ;; + -*) echo "unkown option $1" + exit 1 + ;; + *) break + ;; + esac + done + + echo '#! /bin/sh + # This is a shell archive. Remove anything before this line, then feed it + # into a shell via "sh file" or similar. To overwrite existing files, + # type "sh file -c" + # + # Wrapped by <'`logname`@`(uname -n || hostname) 2>/dev/null`'> on '`date` + echo '# + # This archive contains:' + echo $@ | tr ' ' '\012' | sed -e 's/^/# /' + + # Tell the user what it is all about + echo "echo \"If this archive is complete, you will see the following message:\"" + if test $max -eq 1; then + echo "echo ' \"shar: End of archive.\"'" + else + echo "echo ' \"shar: End of archive $number (of $max).\"'" + fi + + for i + do + # Do not extract file if one with the same name already exists + echo "if test -f '$i' -a \"\${1}\" != \"-c\"; then" + echo " echo \"shar: Will not clobber existing file '$i'\"" + echo "else" + size=`wc -c < $i` + size=`expr "$size" : '\ *\(.*\)'` + echo " echo \"shar: Extracting '$i' (${size}characters)\"" + # Insert X at the front, in case END_OF_FILE appears in the file + echo " sed 's/^X//' > $i << 'END_OF_FILE'" + sed 's/^/X/' $i + echo "END_OF_FILE" + # restore executables + if test -x $i; then + echo " chmod +x $i" + fi + # verify length + echo " if test $size -ne \`wc -c < '$i'\`; then" + echo " echo \"shar: '$i' unpacked with wrong size!\"" + echo " fi" + echo " # end of '$i'" + echo "fi" + done + + # End of shell archive + if test $max -eq 1; then + echo "echo \"End of archive.\"" + else + echo "echo \"End of archive $number (of $max).\"" + echo "cp /dev/null ark${number}isdone" + echo "missing=''" + vector=`awk "BEGIN {for (i=1;i<=$max;i++) printf(\"%d \",i);}" /dev/null` + echo "for i in $vector; do" + echo " if test ! -f ark\${i}isdone; then" + echo " missing=\"\$missing \$i\"" + echo " fi" + echo "done" + echo "if test \"\$missing\" = \"\"; then" + if test $max -eq 2; then + echo " echo \"You have unpacked both archives\"" + else + echo " echo \"You have unpacked all $max archives\"" + fi + echo " rm -f ark*isdone" + echo "else" + echo " echo \"You still must unpack the following archives:\"" + echo " echo \" \" \$missing" + echo "fi" + fi + + # Someone might mail this :-) so skip signature + echo "exit 0" + !NO!SUBS! + chmod 755 rshar + $eunicefix rshar Index: shar/makeshar.SH *** shar/makeshar.SH.old Sat Jan 11 19:25:13 1992 --- shar/makeshar.SH Sat Jan 11 19:25:14 1992 *************** *** 0 **** --- 1,131 ---- + case $CONFIG in + '') + if test ! -f config.sh; then + ln ../config.sh . || \ + ln ../../config.sh . || \ + ln ../../../config.sh . || \ + (echo "Can't find config.sh."; exit 1) + fi 2>/dev/null + . config.sh + ;; + esac + case "$0" in + */*) cd `expr X$0 : 'X\(.*\)/'` ;; + esac + echo "Extracting shar/makeshar (with variable substitutions)" + $spitshell >makeshar <>makeshar <<'!NO!SUBS!' + # This is a stripped down implementation of Rich Salz's makekit. The name is + # a little pun on words: In his cshar packagem Rich called its wrapper makekit + # so it seemed logical to call the kit's wrapper makeshar. + # It is not intended to be used directly. Rather, it is called by kit when + # cshar is missing. + + # Default settings + partname=Part + + # Option parsing + for i in $* + do + case "$i" in + -n) shift + partname="$1" + shift + ;; + -*) echo "unknown option $i" + exit 1 + ;; + *) break + ;; + esac + done + + ( + for i + do + # Ignore directories and other symbolic links + if test -f $i; then + echo "`wc -c < $i` $i" + fi + done + ) | sort -r | awk ' + # Awk is fed with a list of sizes and filenames, sorted in reverse order, + # i.e. the biggest files come first. Its output is a list of files to be + # put in the archives, each line counting for one part. The first line is + # the number of archives to be used. + BEGIN { + maxsize = 50000; # Maximum shar size + kitover = 1700; # Kit overhead + file = 130; # File overhead + max = 1; # Maximum part number + + # We mimic makekit as much as possible to avoid any surprise for user + print " File Name Archive # Description"; + print "----------------------------------------------------------"; + } + { + # Fill in parts, starting with bigger files and finishing with smaller + # ones. Note that we use an heuristic to compute the overhead of each + # files in the archive. The kit overhead is an estimate. The file overhead + # accounts for the listing in the archive contents as well as tests used + # to check for overwriting. + i = 1; + while ( \ + (newtot = tot[i] + $1 + ($1 / 40) + file) > (maxsize - kitover) \ + && tot[i] > 0 \ + ) + i++; + # Uncomment the following line to add debug + # printf("Adding %s to part %d giving %d bytes\n", $2, i, newtot); + tot[i] = newtot; + list[i] = sprintf("%s %s", list[i], $2); + # Update maximum part number + if (i > max) + max = i; + # Verbose to mimic makekit so that the user has no surprise + printf("%-26.26s %d\n", $2, i); + } + END { + # Print the number of parts used + print max > "zzz.list"; + # Print the list of files to be put in each archive + for (i = 1; i <= max; i++) + print list[i] >> "zzz.list"; + } + ' + $name + i=`expr $i + 1` + done + ) + rm -f zzz.list + exit 0 + + !NO!SUBS! + chmod 755 makeshar + $eunicefix makeshar Index: config.h.SH Prereq: 2.0.1.5 *** config.h.SH.old Sat Jan 11 19:24:27 1992 --- config.h.SH Sat Jan 11 19:24:28 1992 *************** *** 20,26 **** * that running config.h.SH again will wipe out any changes you've made. * For a more permanent change edit config.sh and rerun config.h.SH. * ! * \$Id: config.h.SH,v 2.0.1.5 91/11/25 15:48:49 ram Exp $ */ #ifndef _config_h_ --- 20,26 ---- * that running config.h.SH again will wipe out any changes you've made. * For a more permanent change edit config.sh and rerun config.h.SH. * ! * \$Id: config.h.SH,v 2.0.1.6 92/01/11 19:13:18 ram Exp $ */ #ifndef _config_h_ *************** *** 32,37 **** --- 32,43 ---- */ #define BYTEORDER 0x$byteorder /* large digits for MSB */ + /* bcopy: + * This symbol is maped to memcpy if the bcopy() routine is not + * available to copy strings. + */ + #$d_bcopy bcopy(s,d,l) memcpy((d),(s),(l)) /* mapped to memcpy */ + /* GETOPT: * This symbol, if defined, indicates that the getopt() routine exists. */ *************** *** 61,66 **** --- 67,78 ---- */ #$d_memset MEMSET /**/ + /* perror: + * This symbol is maped to null if the perror() routine is not + * available to print system error messages. + */ + #$d_perror perror(s) ; /* mapped to a null statement */ + /* SIGNAL_T: * This symbol's value is either "void" or "int", corresponding to the * appropriate return type of a signal handler. Thus, you can declare *************** *** 69,74 **** --- 81,92 ---- */ #define SIGNAL_T $signal_t /* Kept for backward compatibility */ + /* I_FCNTL: + * This symbol, if defined, indicates to the C program that it should + * include . + */ + #$i_fcntl I_FCNTL /**/ + /* I_SYSIOCTL: * This symbol, if defined, indicates that exists and should * be included. Otherwise, include or . *************** *** 119,124 **** --- 137,149 ---- #$define void int /* is void to be avoided? */ #$define M_VOID /* Xenix strikes again */ #endif + + /* TAPEDEV: + * This symbol hols the full path name of the default tape device. It + * is usually located in /dev under the name rmt or rst followed by a + * single digit. + */ + #define TAPEDEV "$tapedev" /**/ #endif !GROK!THIS! Index: kit/mailkit.SH Prereq: 2.0.1.4 *** kit/mailkit.SH.old Sat Jan 11 19:24:45 1992 --- kit/mailkit.SH Sat Jan 11 19:24:45 1992 *************** *** 14,25 **** esac echo "Extracting kit/mailkit (with variable substitutions)" $spitshell >mailkit <mailkit < + # # Revision 2.0.1.4 91/12/08 14:55:22 ram # patch10: forgot to protect evaluation of variable in a test # *************** *** 116,121 **** --- 121,128 ---- ;; -*) echo "unknown option $1" eval $usage + ;; + *) break ;; esac done Index: man/mailkit.SH *** man/mailkit.SH.old Sat Jan 11 19:25:02 1992 --- man/mailkit.SH Sat Jan 11 19:25:02 1992 *************** *** 15,20 **** echo "Extracting man/mailkit.$manext (with variable substitutions)" $rm -f mailkit.$manext $spitshell >mailkit.$manext <mailkit.$manext < + * * Revision 2.0.1.1 91/04/01 15:39:35 ram * patch1: created * *************** *** 179,184 **** --- 183,195 ---- 010,04,02,01 }; static int desmode; + + /* Declare static functions */ + static permute(); + static round(); + static long f(); + static perminit(); + static int spinit(); /* Allocate space and initialize DES lookup arrays * mode == 0: standard Data Encryption Algorithm Index: man/atob.SH *** man/atob.SH.old Sat Jan 11 19:24:53 1992 --- man/atob.SH Sat Jan 11 19:24:54 1992 *************** *** 15,20 **** echo "Extracting man/atob.$manext (with variable substitutions)" $rm -f atob.$manext $spitshell >atob.$manext <atob.$manext <