home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / unix / volume25 / kit / pch12 < prev    next >
Encoding:
Text File  |  1992-01-11  |  23.3 KB  |  867 lines

  1. Newsgroups: comp.sources.unix
  2. From: ram@eiffel.com (Raphael Manfredi)
  3. Subject: v25i102: kit - the ultimate mailing kit, Patch12
  4. Sender: sources-moderator@pa.dec.com
  5. Approved: vixie@pa.dec.com
  6.  
  7. Submitted-By: ram@eiffel.com (Raphael Manfredi)
  8. Posting-Number: Volume 25, Issue 102
  9. Archive-Name: kit/pch12
  10.  
  11. [The latest patch for kit version 2.0 is #12.
  12.     ram@eiffel.com (Raphael Manfredi)
  13. ]
  14.  
  15. System: kit version 2.0
  16. Patch #: 12
  17. Priority: LOW
  18. Subject: patch #11, continued
  19. Date: Sat Jan 11 19:32:09 PST 1992
  20. From: Raphael Manfredi <ram@eiffel.com>
  21.  
  22. Description:
  23.     See patch #11.
  24.  
  25.  
  26. Fix:    From rn, say "| patch -p -N -d DIR", where DIR is your kit source
  27.     directory.  Outside of rn, say "cd DIR; patch -p -N <thisarticle".
  28.     If you don't have the patch program, apply the following by hand,
  29.     or get patch (version 2.0, latest patchlevel).
  30.  
  31.     After patching:
  32.         Configure
  33.         make
  34.         make install
  35.  
  36.     If patch indicates that patchlevel is the wrong version, you may need
  37.     to apply one or more previous patches, or the patch may already
  38.     have been applied.  See the patchlevel.h file to find out what has or
  39.     has not been applied.  In any event, don't continue with the patch.
  40.  
  41.     If you are missing previous patches they can be obtained from me:
  42.  
  43.         Raphael Manfredi <ram@eiffel.com>
  44.  
  45.     If you send a mail message of the following form it will greatly speed
  46.     processing:
  47.  
  48.         Subject: Command
  49.         @SH mailpatch PATH kit 2.0 LIST
  50.                ^ note the c
  51.  
  52.     where PATH is a return path FROM ME TO YOU either in Internet notation,
  53.     or in bang notation from some well-known host, and LIST is the number
  54.     of one or more patches you need, separated by spaces, commas, and/or
  55.     hyphens.  Saying 35- says everything from 35 to the end.
  56.  
  57.     To get some more detailed instructions, send me the following mail:
  58.  
  59.         Subject: Command
  60.         @SH mailhelp PATH
  61.  
  62.  
  63. Index: patchlevel.h
  64. Prereq: 11
  65. 2c2
  66. < #define PATCHLEVEL 11
  67. ---
  68. > #define PATCHLEVEL 12
  69.  
  70. Index: badtar/badtar.SH
  71. *** badtar/badtar.SH.old    Sat Jan 11 19:24:20 1992
  72. --- badtar/badtar.SH    Sat Jan 11 19:24:21 1992
  73. ***************
  74. *** 0 ****
  75. --- 1,125 ----
  76. + case $CONFIG in
  77. + '')
  78. +     if test ! -f config.sh; then
  79. +     ln ../config.sh . || \
  80. +     ln ../../config.sh . || \
  81. +     ln ../../../config.sh . || \
  82. +     (echo "Can't find config.sh."; exit 1)
  83. +     fi 2>/dev/null
  84. +     . config.sh
  85. +     ;;
  86. + esac
  87. + case "$0" in
  88. + */*) cd `expr X$0 : 'X\(.*\)/'` ;;
  89. + esac
  90. + echo "Extracting man/badtar.$manext (with variable substitutions)"
  91. + $rm -f badtar.$manext
  92. + $spitshell >badtar.$manext <<!GROK!THIS!
  93. + .TH BABTAR $manext ram
  94. + ''' @(#) Manual page for badtar -- (c) ram January 1992
  95. + '''
  96. + ''' $Id: badtar.SH,v 2.0.1.1 92/01/11 19:12:35 ram Exp $
  97. + '''
  98. + ''' $Log:    badtar.SH,v $
  99. + ''' Revision 2.0.1.1  92/01/11  19:12:35  ram
  100. + ''' patch11: created
  101. + ''' 
  102. + '''
  103. + .SH NAME
  104. + badtar \- a filter for damaged tar files
  105. + .SH SYNOPSIS
  106. + \fBbadtar\fR [ \-\fBhiorsvV\fR ] [ \-\fBl\fI logfile\fR ]
  107. + [ \-\fBf\fI tape_drive\fR ] [ \-\fBu\fI uid\fR ] [ \-\fBg\fI gid\fR ]
  108. + .SH DESCRIPTION
  109. + \fIBadtar\fR can be used to extract files from a tar tape which
  110. + contains read errors. It is used as a filter whose output should be piped
  111. + into tar thus:
  112. + .sp
  113. + .in +5
  114. + badtar -f /dev/rmt0 -l logfile | tar xvf -
  115. + .in -5
  116. + .sp
  117. + This program is not perfect. It cannot read what cannot be read, but it
  118. + will continue over read errors, pad files to suitable lengths when blocks
  119. + are missing, ignore files whose header tar blocks are mangled, etc...
  120. + .PP
  121. + It is possible to read from a pipe by giving \- as argument to \-\fBf\fR.
  122. + However in that case, you need another program to read the tape device
  123. + (for instance \fIdd\fR) and read erros may be fatal. Besides, \fIbadtar\fR has
  124. + some neat options which let you overwrite the owner of the files in the
  125. + archive or strip the leading '/' in the path name to make them relative.
  126. + Here is a way of reading from a remote tape drive located on \fImoon\fR:
  127. + .sp
  128. + .in +5
  129. + remsh moon dd if=/dev/rmt0 conv=noerror,sync | \\\\
  130. + .br
  131. + badtar -f - | tar xvf -
  132. + .in -5
  133. + .sp
  134. + .PP
  135. + The log file (\-\fBl\fR flag) gives a list of all files found, indicates which
  136. + of them were padded, shows where blocks were deleted (i.e. files were lost)
  137. + and where bad blocks occured on the tape. You can get a good idea from this
  138. + list where files will have been mangled or lost. All error messages begin with
  139. + *** which makes life easier to find errors in a long list.
  140. + If the \-\fBl\fR flag is not given stderr is defaulted. If the \-\fBf\fR flag
  141. + is not given \fI$tapedev\fR is defaulted.
  142. + .SH OPTIONS
  143. + .TP 10
  144. + \-\fBf\fI file\fR
  145. + tells \fIbadtar\fR the output is to be taken from file \fIfile\fR. Use \- to
  146. + read standard input. By default, \fIbadtar\fR attempts to read \fI$tapedev\fR.
  147. + .TP
  148. + \-\fBg\fI gid\fR
  149. + directs \fIbadtar\fR to overwrite group membership to \fIgid\fR on file
  150. + extraction.
  151. + The \fIgid\fR has to be given in numeric form. Use \fI0\fR to force the
  152. + \fIgid\fR of the user running badtar.
  153. + .TP
  154. + \-\fBh\fR
  155. + prints the usage message and exits.
  156. + .TP
  157. + \-\fBi\fR
  158. + makes \fIbadtar\fR ignore the end of tape blocks. There is a risk \fIbadtar\fR
  159. + enters in an infinite loop when this option is used.
  160. + .TP
  161. + \-\fBl\fI logfile\fR
  162. + sets a logfile for \fIbadtar\fR to redirect his error messages. By default,
  163. + the standard error is used.
  164. + .TP
  165. + \-\fBo\fR
  166. + directs \fIbadtar\fR to overwrite the ownership of the file (both \fIuid\fR and
  167. + \fIgid\fR). It is a shortcut for \-\fBu\fI 0 \fR\-\fBg\fI 0\fR.
  168. + .TP
  169. + \-\fBr\fR
  170. + builds relative paths out of absolute ones by removing the leading slash in the
  171. + file name.
  172. + .TP
  173. + \-\fBs\fR
  174. + asks for silent mode. No logging is done.
  175. + .TP
  176. + \-\fBu\fI uid\fR
  177. + directs \fIbadtar\fR to overwrite ownership to \fIuid\fR on file
  178. + extraction.
  179. + The \fIuid\fR has to be given in numeric form. Use \fI0\fR to force the
  180. + \fIuid\fR of the user running badtar. This means there is no way to force
  181. + the owner to \fIroot\fR unless \fIbadtar\fR is run by the super-user. It
  182. + is considered to be a feature.
  183. + .TP
  184. + \-\fBv\fR
  185. + asks for verbose mode. The tar headers are written when found on the tape.
  186. + .TP
  187. + \-\fBV\fR
  188. + prints version number and exits.
  189. + .SH "SEE ALSO"
  190. + tar(1)
  191. + .SH AUTHORS
  192. + Mike Williams <mike@erix.UUCP>.
  193. + .br
  194. + Extended by Raphael Manfredi <ram@eiffel.com>.
  195. + .br
  196. + .sp
  197. + \fIBadtar\fR was enhanced at Interactive Software Engineering Inc, Santa
  198. + Barbara, USA.
  199. + !GROK!THIS!
  200. + chmod 444 badtar.$manext
  201.  
  202. Index: kit/unkit.SH
  203. Prereq: 2.0.1.7
  204. *** kit/unkit.SH.old    Sat Jan 11 19:24:49 1992
  205. --- kit/unkit.SH    Sat Jan 11 19:24:50 1992
  206. ***************
  207. *** 19,27 ****
  208.   # @(#) (c) E. Mogenet April 1990
  209.   # @(#) (c) R. Manfredi, 1990 1991
  210.   
  211. ! # $Id: unkit.SH,v 2.0.1.7 91/12/08 14:56:49 ram Exp $
  212.   #
  213.   # $Log:    unkit.SH,v $
  214.   # Revision 2.0.1.7  91/12/08  14:56:49  ram
  215.   # patch10: added space in the credit for Emmanuel Mogenet
  216.   # 
  217. --- 19,31 ----
  218.   # @(#) (c) E. Mogenet April 1990
  219.   # @(#) (c) R. Manfredi, 1990 1991
  220.   
  221. ! # $Id: unkit.SH,v 2.0.1.8 92/01/11 19:20:05 ram Exp $
  222.   #
  223.   # $Log:    unkit.SH,v $
  224. + # Revision 2.0.1.8  92/01/11  19:20:05  ram
  225. + # patch11: now knows about badtar
  226. + # patch11: added -b option to force use of badtar
  227. + # 
  228.   # Revision 2.0.1.7  91/12/08  14:56:49  ram
  229.   # patch10: added space in the credit for Emmanuel Mogenet
  230.   # 
  231. ***************
  232. *** 57,73 ****
  233.   pl='$PATCHLEVEL'
  234.   version='$VERSION'
  235.   
  236.   !GROK!THIS!
  237.   
  238. ! case "$d_taropt_o" in
  239. ! "$define") opt='xvof';;
  240. ! *) opt='xvf';;
  241.   esac
  242. - echo "tar_opt='$opt'" >> unkit
  243.   
  244.   $spitshell >>unkit <<'!NO!SUBS!'
  245.   decoding=hexdecode            # Default decoding program
  246.   preserve=yes                # Preserve input files by default
  247.   
  248.   # In case we are interrupted, remove all the temporary files
  249.   trap 'test -f zzz.minikit && rm -f `cat zzz.minikit` zzz.minikit; \
  250. --- 61,92 ----
  251.   pl='$PATCHLEVEL'
  252.   version='$VERSION'
  253.   
  254. + # Tar options to be used
  255. + badtar='$needbtar'
  256.   !GROK!THIS!
  257.   
  258. ! case "$d_portable" in
  259. ! define) cat >> unkit <<EOP
  260. ! if tar -cf - /dev/null 2>/dev/null | tar -xof - >/dev/null 2>&1; then
  261. !     tar_opt='xvof'
  262. ! else
  263. !     tar_opt='xvf'
  264. ! fi
  265. ! EOP
  266. !     ;;
  267. ! *) case "$d_taropt_o" in
  268. !     "$define") opt='xvof';;
  269. !     *) opt='xvf';;
  270. !     esac
  271. !     echo "tar_opt='$opt'" >> unkit
  272. !     ;;
  273.   esac
  274.   
  275.   $spitshell >>unkit <<'!NO!SUBS!'
  276.   decoding=hexdecode            # Default decoding program
  277.   preserve=yes                # Preserve input files by default
  278. + usebtar=''                    # Do not use badtar
  279.   
  280.   # In case we are interrupted, remove all the temporary files
  281.   trap 'test -f zzz.minikit && rm -f `cat zzz.minikit` zzz.minikit; \
  282. ***************
  283. *** 75,81 ****
  284.   
  285.   # Old Bourne shells do not have functions
  286.   usage='
  287. ! echo "Usage: unkit [-hlprV] [file1 ... filen]";
  288.   echo " "" -h : give this help message.";
  289.   echo " "" -l : list the contents of a the kit files.";
  290.   echo " "" -p : preserve input files (default).";
  291. --- 94,101 ----
  292.   
  293.   # Old Bourne shells do not have functions
  294.   usage='
  295. ! echo "Usage: unkit [-bhlprV] [file1 ... filen]";
  296. ! echo " "" -b : force use of badtar ($badtar by default).";
  297.   echo " "" -h : give this help message.";
  298.   echo " "" -l : list the contents of a the kit files.";
  299.   echo " "" -p : preserve input files (default).";
  300. ***************
  301. *** 101,108 ****
  302. --- 121,131 ----
  303.       -l) tar_opt=tvf
  304.           preserve=yes
  305.           shift;;
  306. +     -b) usebtar='true'
  307. +         shift;;
  308.       -*) echo "Unknown option $i"
  309.           eval $usage;;
  310. +     *) break;;
  311.       esac
  312.   done
  313.   
  314. ***************
  315. *** 146,157 ****
  316.       decoding=$decoding" | des -d -b"
  317.   fi
  318.   
  319. ! echo "Decoding with $decoding"
  320.   
  321.   cat `ls z??.[hb][ea]*.??` |
  322.   eval $decoding        |
  323.   zcat                |
  324. ! tar $tar_opt -
  325.   
  326.   test -f zzz.minikit && rm -f `cat zzz.minikit` zzz.minikit
  327.   rm -f z??.[hb][ea]*.??
  328. --- 169,191 ----
  329.       decoding=$decoding" | des -d -b"
  330.   fi
  331.   
  332. ! # Maybe we need badtar...
  333. ! case "$badtar" in
  334. ! true) tarcmd="badtar -s -o -f - | tar $tar_opt -";;
  335. ! *) if test "$usebtar"; then
  336. !         tarcmd="badtar -s -o -f - | tar $tar_opt -"
  337. !     else
  338. !         tarcmd="tar $tar_opt -"
  339. !     fi
  340. !     ;;
  341. ! esac
  342. ! echo "Decoding with $decoding | zcat | $tarcmd"
  343.   
  344.   cat `ls z??.[hb][ea]*.??` |
  345.   eval $decoding        |
  346.   zcat                |
  347. ! eval "$tarcmd"
  348.   
  349.   test -f zzz.minikit && rm -f `cat zzz.minikit` zzz.minikit
  350.   rm -f z??.[hb][ea]*.??
  351.  
  352. Index: man/unkit.SH
  353. *** man/unkit.SH.old    Sat Jan 11 19:25:05 1992
  354. --- man/unkit.SH    Sat Jan 11 19:25:05 1992
  355. ***************
  356. *** 15,20 ****
  357.   echo "Extracting man/unkit.$manext (with variable substitutions)"
  358.   $rm -f unkit.$manext
  359.   $spitshell >unkit.$manext <<!GROK!THIS!
  360. ! .so $mansrc/kit.$manext
  361.   !GROK!THIS!
  362.   chmod 444 unkit.$manext
  363. --- 15,20 ----
  364.   echo "Extracting man/unkit.$manext (with variable substitutions)"
  365.   $rm -f unkit.$manext
  366.   $spitshell >unkit.$manext <<!GROK!THIS!
  367. ! .so man$manext/kit.$manext
  368.   !GROK!THIS!
  369.   chmod 444 unkit.$manext
  370.  
  371. Index: shar/rshar.SH
  372. *** shar/rshar.SH.old    Sat Jan 11 19:25:17 1992
  373. --- shar/rshar.SH    Sat Jan 11 19:25:17 1992
  374. ***************
  375. *** 0 ****
  376. --- 1,133 ----
  377. + case $CONFIG in
  378. + '')
  379. +     if test ! -f config.sh; then
  380. +         ln ../config.sh . || \
  381. +         ln ../../config.sh . || \
  382. +         ln ../../../config.sh . || \
  383. +         (echo "Can't find config.sh."; exit 1)
  384. +     fi 2>/dev/null
  385. +     . config.sh
  386. +     ;;
  387. + esac
  388. + case "$0" in
  389. + */*) cd `expr X$0 : 'X\(.*\)/'` ;;
  390. + esac
  391. + echo "Extracting shar/rshar (with variable substitutions)"
  392. + $spitshell >rshar <<!GROK!THIS!
  393. + $startsh
  394. + # (c) Raphael Manfredi, December 25th 1991
  395. + # $Id: rshar.SH,v 2.0.1.1 92/01/11 19:23:24 ram Exp $
  396. + #
  397. + # $Log:    rshar.SH,v $
  398. + # Revision 2.0.1.1  92/01/11  19:23:24  ram
  399. + # patch11: created
  400. + # 
  401. + !GROK!THIS!
  402. + $spitshell >>rshar <<'!NO!SUBS!'
  403. + # This is a stripped down implementation of Rich Salz's cshar. Among the
  404. + # list of features missing, no directories are ever created: rshar assumes
  405. + # the list of files to be shar'ed are listed in a single directory, which
  406. + # is the case with kit.
  407. + # It is not intended to be used directly. Rather, it is called by makeshar
  408. + # via kit when cshar is missing.
  409. + # Default values
  410. + max=1
  411. + number=1
  412. + # Option parsing
  413. + for i in $*
  414. + do
  415. +     case "$i" in
  416. +     -k) shift
  417. +         max=$1
  418. +         shift
  419. +         ;;
  420. +     -n) shift
  421. +         number=$1
  422. +         shift
  423. +         ;;
  424. +     -*) echo "unkown option $1"
  425. +         exit 1
  426. +         ;;
  427. +     *) break
  428. +         ;;
  429. +     esac
  430. + done
  431. + echo '#! /bin/sh
  432. + # This is a shell archive.  Remove anything before this line, then feed it
  433. + # into a shell via "sh file" or similar.  To overwrite existing files,
  434. + # type "sh file -c"
  435. + #
  436. + # Wrapped by <'`logname`@`(uname -n || hostname) 2>/dev/null`'> on '`date`
  437. + echo '#
  438. + # This archive contains:'
  439. + echo $@ | tr ' ' '\012' | sed -e 's/^/#    /'
  440. + # Tell the user what it is all about
  441. + echo "echo \"If this archive is complete, you will see the following message:\""
  442. + if test $max -eq 1; then
  443. +     echo "echo '          \"shar: End of archive.\"'"
  444. + else
  445. +     echo "echo '          \"shar: End of archive $number (of $max).\"'"
  446. + fi
  447. + for i
  448. + do
  449. +     # Do not extract file if one with the same name already exists
  450. +     echo "if test -f '$i' -a \"\${1}\" != \"-c\"; then"
  451. +     echo "    echo \"shar: Will not clobber existing file '$i'\""
  452. +     echo "else"
  453. +     size=`wc -c < $i`
  454. +     size=`expr "$size" : '\ *\(.*\)'`
  455. +     echo "    echo \"shar: Extracting '$i' (${size}characters)\""
  456. +     # Insert X at the front, in case END_OF_FILE appears in the file
  457. +     echo "    sed 's/^X//' > $i << 'END_OF_FILE'"
  458. +     sed 's/^/X/' $i
  459. +     echo "END_OF_FILE"
  460. +     # restore executables
  461. +     if test -x $i; then
  462. +         echo "    chmod +x $i"
  463. +     fi
  464. +     # verify length
  465. +     echo "    if test $size -ne \`wc -c < '$i'\`; then"
  466. +     echo "        echo \"shar: '$i' unpacked with wrong size!\""
  467. +     echo "    fi"
  468. +     echo "    # end of '$i'"
  469. +     echo "fi"
  470. + done
  471. + # End of shell archive
  472. + if test $max -eq 1; then
  473. +     echo "echo \"End of archive.\""
  474. + else
  475. +     echo "echo \"End of archive $number (of $max).\""
  476. +     echo "cp /dev/null ark${number}isdone"
  477. +     echo "missing=''"
  478. +     vector=`awk "BEGIN {for (i=1;i<=$max;i++) printf(\"%d \",i);}" /dev/null`
  479. +     echo "for i in $vector; do"
  480. +     echo "    if test ! -f ark\${i}isdone; then"
  481. +     echo "        missing=\"\$missing \$i\""
  482. +     echo "    fi"
  483. +     echo "done"
  484. +     echo "if test \"\$missing\" = \"\"; then"
  485. +     if test $max -eq 2; then
  486. +         echo "    echo \"You have unpacked both archives\""
  487. +     else
  488. +         echo "    echo \"You have unpacked all $max archives\""
  489. +     fi
  490. +     echo "    rm -f ark*isdone"
  491. +     echo "else"
  492. +     echo "    echo \"You still must unpack the following archives:\""
  493. +     echo "    echo \"        \" \$missing"
  494. +     echo "fi"
  495. + fi
  496. + # Someone might mail this :-) so skip signature
  497. + echo "exit 0"
  498. + !NO!SUBS!
  499. + chmod 755 rshar
  500. + $eunicefix rshar
  501.  
  502. Index: shar/makeshar.SH
  503. *** shar/makeshar.SH.old    Sat Jan 11 19:25:13 1992
  504. --- shar/makeshar.SH    Sat Jan 11 19:25:14 1992
  505. ***************
  506. *** 0 ****
  507. --- 1,131 ----
  508. + case $CONFIG in
  509. + '')
  510. +     if test ! -f config.sh; then
  511. +         ln ../config.sh . || \
  512. +         ln ../../config.sh . || \
  513. +         ln ../../../config.sh . || \
  514. +         (echo "Can't find config.sh."; exit 1)
  515. +     fi 2>/dev/null
  516. +     . config.sh
  517. +     ;;
  518. + esac
  519. + case "$0" in
  520. + */*) cd `expr X$0 : 'X\(.*\)/'` ;;
  521. + esac
  522. + echo "Extracting shar/makeshar (with variable substitutions)"
  523. + $spitshell >makeshar <<!GROK!THIS!
  524. + $startsh
  525. + # (c) Raphael Manfredi, December 25th 1991
  526. + # $Id: makeshar.SH,v 2.0.1.1 92/01/11 19:23:16 ram Exp $
  527. + #
  528. + # $Log:    makeshar.SH,v $
  529. + # Revision 2.0.1.1  92/01/11  19:23:16  ram
  530. + # patch11: created
  531. + # 
  532. + # Where rshar is located
  533. + libdir='$privlib'
  534. + !GROK!THIS!
  535. + $spitshell >>makeshar <<'!NO!SUBS!'
  536. + # This is a stripped down implementation of Rich Salz's makekit. The name is
  537. + # a little pun on words: In his cshar packagem Rich called its wrapper makekit
  538. + # so it seemed logical to call the kit's wrapper makeshar.
  539. + # It is not intended to be used directly. Rather, it is called by kit when
  540. + # cshar is missing.
  541. + # Default settings
  542. + partname=Part
  543. + # Option parsing
  544. + for i in $*
  545. + do
  546. +     case "$i" in
  547. +     -n) shift
  548. +         partname="$1"
  549. +         shift
  550. +         ;;
  551. +     -*) echo "unknown option $i"
  552. +         exit 1
  553. +         ;;
  554. +     *) break
  555. +         ;;
  556. +     esac
  557. + done
  558. + (
  559. +     for i
  560. +     do
  561. +         # Ignore directories and other symbolic links
  562. +         if test -f $i; then
  563. +             echo "`wc -c < $i` $i"
  564. +         fi
  565. +     done
  566. + ) | sort -r | awk '
  567. + # Awk is fed with a list of sizes and filenames, sorted in reverse order,
  568. + # i.e. the biggest files come first. Its output is a list of files to be
  569. + # put in the archives, each line counting for one part. The first line is
  570. + # the number of archives to be used.
  571. + BEGIN {
  572. +     maxsize = 50000;    # Maximum shar size
  573. +     kitover = 1700;        # Kit overhead
  574. +     file = 130;            # File overhead
  575. +     max = 1;            # Maximum part number
  576. +     # We mimic makekit as much as possible to avoid any surprise for user
  577. +     print "   File Name            Archive #       Description";
  578. +     print "----------------------------------------------------------";
  579. + }
  580. + {
  581. +     # Fill in parts, starting with bigger files and finishing with smaller
  582. +     # ones. Note that we use an heuristic to compute the overhead of each
  583. +     # files in the archive. The kit overhead is an estimate. The file overhead
  584. +     # accounts for the listing in the archive contents as well as tests used
  585. +     # to check for overwriting.
  586. +     i = 1;
  587. +     while ( \
  588. +         (newtot = tot[i] + $1 + ($1 / 40) + file) > (maxsize - kitover) \
  589. +         && tot[i] > 0 \
  590. +     )
  591. +         i++;
  592. +     # Uncomment the following line to add debug
  593. +     # printf("Adding %s to part %d giving %d bytes\n", $2, i, newtot);
  594. +     tot[i] = newtot;
  595. +     list[i] = sprintf("%s %s", list[i], $2);
  596. +     # Update maximum part number
  597. +     if (i > max)
  598. +         max = i;
  599. +     # Verbose to mimic makekit so that the user has no surprise
  600. +     printf("%-26.26s %d\n", $2, i);
  601. + }
  602. + END {
  603. +     # Print the number of parts used
  604. +     print max > "zzz.list";
  605. +     # Print the list of files to be put in each archive
  606. +     for (i = 1; i <= max; i++)
  607. +         print list[i] >> "zzz.list";
  608. + }
  609. + '
  610. + <zzz.list (
  611. +     # Now back to the shell, parse the output from awk and invoke rshar
  612. +     read max;
  613. +     i=1
  614. +     while read first last
  615. +     do
  616. +         if test $i -lt 10; then
  617. +             name=${partname}0$i
  618. +         else
  619. +             name=${partname}$i
  620. +         fi
  621. +         echo "Packing kit $i..."
  622. +         $libdir/rshar -k $max -n $i $first $last > $name
  623. +         i=`expr $i + 1`
  624. +     done
  625. + )
  626. + rm -f zzz.list
  627. + exit 0
  628. + !NO!SUBS!
  629. + chmod 755 makeshar
  630. + $eunicefix makeshar
  631.  
  632. Index: config.h.SH
  633. Prereq: 2.0.1.5
  634. *** config.h.SH.old    Sat Jan 11 19:24:27 1992
  635. --- config.h.SH    Sat Jan 11 19:24:28 1992
  636. ***************
  637. *** 20,26 ****
  638.    * that running config.h.SH again will wipe out any changes you've made.
  639.    * For a more permanent change edit config.sh and rerun config.h.SH.
  640.    *
  641. !  * \$Id: config.h.SH,v 2.0.1.5 91/11/25 15:48:49 ram Exp $
  642.    */
  643.   
  644.   #ifndef _config_h_
  645. --- 20,26 ----
  646.    * that running config.h.SH again will wipe out any changes you've made.
  647.    * For a more permanent change edit config.sh and rerun config.h.SH.
  648.    *
  649. !  * \$Id: config.h.SH,v 2.0.1.6 92/01/11 19:13:18 ram Exp $
  650.    */
  651.   
  652.   #ifndef _config_h_
  653. ***************
  654. *** 32,37 ****
  655. --- 32,43 ----
  656.    */
  657.   #define BYTEORDER 0x$byteorder    /* large digits for MSB */
  658.   
  659. + /* bcopy:
  660. +  *    This symbol is maped to memcpy if the  bcopy() routine is not
  661. +  *    available to copy strings.
  662. +  */
  663. + #$d_bcopy bcopy(s,d,l) memcpy((d),(s),(l))        /* mapped to memcpy */
  664.   /* GETOPT:
  665.    *    This symbol, if defined, indicates that the getopt() routine exists.
  666.    */
  667. ***************
  668. *** 61,66 ****
  669. --- 67,78 ----
  670.    */
  671.   #$d_memset    MEMSET        /**/
  672.   
  673. + /* perror:
  674. +  *    This symbol is maped to null if the  perror() routine is not
  675. +  *    available to print system error messages.
  676. +  */
  677. + #$d_perror    perror(s)    ;    /* mapped to a null statement */
  678.   /* SIGNAL_T:
  679.    *    This symbol's value is either "void" or "int", corresponding to the
  680.    *    appropriate return type of a signal handler.  Thus, you can declare
  681. ***************
  682. *** 69,74 ****
  683. --- 81,92 ----
  684.    */
  685.   #define SIGNAL_T $signal_t    /* Kept for backward compatibility */
  686.   
  687. + /* I_FCNTL:
  688. +  *    This symbol, if defined, indicates to the C program that it should
  689. +  *    include <fcntl.h>.
  690. +  */
  691. + #$i_fcntl    I_FCNTL        /**/
  692.   /* I_SYSIOCTL:
  693.    *    This symbol, if defined, indicates that <sys/ioctl.h> exists and should
  694.    *    be included. Otherwise, include <sgtty.h> or <termio.h>.
  695. ***************
  696. *** 119,124 ****
  697. --- 137,149 ----
  698.   #$define void int        /* is void to be avoided? */
  699.   #$define M_VOID            /* Xenix strikes again */
  700.   #endif
  701. + /* TAPEDEV:
  702. +  *    This symbol hols the full path name of the default tape device. It
  703. +  *    is usually located in /dev under the name rmt or rst followed by a
  704. +  *    single digit.
  705. +  */
  706. + #define TAPEDEV "$tapedev"    /**/
  707.   
  708.   #endif
  709.   !GROK!THIS!
  710.  
  711. Index: kit/mailkit.SH
  712. Prereq: 2.0.1.4
  713. *** kit/mailkit.SH.old    Sat Jan 11 19:24:45 1992
  714. --- kit/mailkit.SH    Sat Jan 11 19:24:45 1992
  715. ***************
  716. *** 14,25 ****
  717.   esac
  718.   echo "Extracting kit/mailkit (with variable substitutions)"
  719.   $spitshell >mailkit <<!GROK!THIS!
  720.   # @(#) Mailer for kit files
  721.   # @(#) (c) R. Manfredi, 1990 1991
  722.   
  723. ! # $Id: mailkit.SH,v 2.0.1.4 91/12/08 14:55:22 ram Exp $
  724.   #
  725.   # $Log:    mailkit.SH,v $
  726.   # Revision 2.0.1.4  91/12/08  14:55:22  ram
  727.   # patch10: forgot to protect evaluation of variable in a test
  728.   # 
  729. --- 14,30 ----
  730.   esac
  731.   echo "Extracting kit/mailkit (with variable substitutions)"
  732.   $spitshell >mailkit <<!GROK!THIS!
  733. + $startsh
  734.   # @(#) Mailer for kit files
  735.   # @(#) (c) R. Manfredi, 1990 1991
  736.   
  737. ! # $Id: mailkit.SH,v 2.0.1.5 92/01/11 19:19:15 ram Exp $
  738.   #
  739.   # $Log:    mailkit.SH,v $
  740. + # Revision 2.0.1.5  92/01/11  19:19:15  ram
  741. + # patch11: the leading 'startsh' configuration variable was missing
  742. + # patch11: reported by Michael Fischer <fischer-michael@cs.yale.edu>
  743. + # 
  744.   # Revision 2.0.1.4  91/12/08  14:55:22  ram
  745.   # patch10: forgot to protect evaluation of variable in a test
  746.   # 
  747. ***************
  748. *** 116,121 ****
  749. --- 121,128 ----
  750.           ;;
  751.       -*) echo "unknown option $1"
  752.           eval $usage
  753. +         ;;
  754. +     *) break
  755.           ;;
  756.       esac
  757.   done
  758.  
  759. Index: man/mailkit.SH
  760. *** man/mailkit.SH.old    Sat Jan 11 19:25:02 1992
  761. --- man/mailkit.SH    Sat Jan 11 19:25:02 1992
  762. ***************
  763. *** 15,20 ****
  764.   echo "Extracting man/mailkit.$manext (with variable substitutions)"
  765.   $rm -f mailkit.$manext
  766.   $spitshell >mailkit.$manext <<!GROK!THIS!
  767. ! .so $mansrc/kit.$manext
  768.   !GROK!THIS!
  769.   chmod 444 mailkit.$manext
  770. --- 15,20 ----
  771.   echo "Extracting man/mailkit.$manext (with variable substitutions)"
  772.   $rm -f mailkit.$manext
  773.   $spitshell >mailkit.$manext <<!GROK!THIS!
  774. ! .so man$manext/kit.$manext
  775.   !GROK!THIS!
  776.   chmod 444 mailkit.$manext
  777.  
  778. Index: des/des.c
  779. Prereq: 2.0.1.1
  780. *** des/des.c.old    Sat Jan 11 19:24:35 1992
  781. --- des/des.c    Sat Jan 11 19:24:36 1992
  782. ***************
  783. *** 4,12 ****
  784.    */
  785.   
  786.   /*
  787. !  * $Id: des.c,v 2.0.1.1 91/04/01 15:39:35 ram Exp $
  788.    *
  789.    * $Log:    des.c,v $
  790.    * Revision 2.0.1.1  91/04/01  15:39:35  ram
  791.    * patch1: created
  792.    * 
  793. --- 4,16 ----
  794.    */
  795.   
  796.   /*
  797. !  * $Id: des.c,v 2.0.1.2 92/01/11 19:15:41 ram Exp $
  798.    *
  799.    * $Log:    des.c,v $
  800. +  * Revision 2.0.1.2  92/01/11  19:15:41  ram
  801. +  * patch11: added declarations for static functions
  802. +  * patch11: reported by Monty Solomon <roscom!monty@bu.edu>
  803. +  * 
  804.    * Revision 2.0.1.1  91/04/01  15:39:35  ram
  805.    * patch1: created
  806.    * 
  807. ***************
  808. *** 179,184 ****
  809. --- 183,195 ----
  810.        010,04,02,01
  811.   };
  812.   static int desmode;
  813. + /* Declare static functions */
  814. + static permute();
  815. + static round();
  816. + static long f();
  817. + static perminit();
  818. + static int spinit();
  819.   
  820.   /* Allocate space and initialize DES lookup arrays
  821.    * mode == 0: standard Data Encryption Algorithm
  822.  
  823. Index: man/atob.SH
  824. *** man/atob.SH.old    Sat Jan 11 19:24:53 1992
  825. --- man/atob.SH    Sat Jan 11 19:24:54 1992
  826. ***************
  827. *** 15,20 ****
  828.   echo "Extracting man/atob.$manext (with variable substitutions)"
  829.   $rm -f atob.$manext
  830.   $spitshell >atob.$manext <<!GROK!THIS!
  831. ! .so $mansrc/btoa.$manext
  832.   !GROK!THIS!
  833.   chmod 444 atob.$manext
  834. --- 15,20 ----
  835.   echo "Extracting man/atob.$manext (with variable substitutions)"
  836.   $rm -f atob.$manext
  837.   $spitshell >atob.$manext <<!GROK!THIS!
  838. ! .so man$manext/btoa.$manext
  839.   !GROK!THIS!
  840.   chmod 444 atob.$manext
  841.  
  842. *** End of Patch 12 ***
  843.