home *** CD-ROM | disk | FTP | other *** search
/ Source Code 1994 March / Source_Code_CD-ROM_Walnut_Creek_March_1994.iso / compsrcs / unix / volume26 / kit / pch13 < prev    next >
Encoding:
Text File  |  1992-04-18  |  13.9 KB  |  565 lines

  1. Newsgroups: comp.sources.unix
  2. From: ram@eiffel.com (Raphael Manfredi)
  3. Subject: v26i010: kit - the ultimate mailing kit, Patch13
  4. Sender: unix-sources-moderator@pa.dec.com
  5. Approved: vixie@pa.dec.com
  6.  
  7. Submitted-By: ram@eiffel.com (Raphael Manfredi)
  8. Posting-Number: Volume 26, Issue 10
  9. Archive-Name: kit/pch13
  10.  
  11.  
  12. [The latest patch for kit version 2.0 is #14.]
  13.  
  14. System: kit version 2.0
  15. Patch #: 13
  16. Priority: HIGH
  17. Subject: many thanks to Jaap Vermeulen <jaap@sequent.com>
  18. Subject: fixed the option parsing code
  19. Subject: unkit may be used to actually do an unshar
  20. Subject: the built-in unshar in unkit may now be used alone
  21. Subject: fixed option parsing code
  22. Subject: protected arguments given to rshar
  23. Subject: the archive extraction now returns meaningful exit code
  24. Subject: there is now a space between file size and "characters"
  25. Date: Mon Jan 13 14:27:10 PST 1992
  26. From: Raphael Manfredi <ram@eiffel.com>
  27.  
  28. Description:
  29.     I would like to express my thanks to Jaap Vermeulen <jaap@sequent.com>.
  30.     This patch was issued after a short e-mail exchange when I realized that
  31.     some edges could be polished and the (last, hopefully) bug was fixed.
  32.  
  33.     The option parsing code was wrong!! Yes. Sorry. It worked fine on my
  34.     machine and I havn't heard any complaint regarding that particular
  35.     point, but nonetheless, it was wrong.
  36.  
  37.     Unkit may be used to actually do an unshar. For those who do not have
  38.     'unshar', you may now use 'unkit'. The script will stop after having
  39.     run the shell archives if it does not detect any kit file.
  40.  
  41.     I protected the arguments given to rshar, just in case one file is
  42.     named '-n' or '-k'.
  43.  
  44.     The archive extraction now returns meaningful exit code. If an extraction
  45.     failed or a file was not extracted because it would have overwritten an
  46.     existing file, then the exit status is 1.
  47.  
  48.     There is now a space between file size and "characters". Some 'wc' add
  49.     a trailing space, some don't. I'm now relying on the shell to do the
  50.     job for me (i.e. to remove the tabs and spaces).
  51.  
  52.  
  53. Fix:    From rn, say "| patch -p -N -d DIR", where DIR is your kit source
  54.     directory.  Outside of rn, say "cd DIR; patch -p -N <thisarticle".
  55.     If you don't have the patch program, apply the following by hand,
  56.     or get patch (version 2.0, latest patchlevel).
  57.  
  58.     After patching:
  59.         Configure -d
  60.         make
  61.         make install
  62.  
  63.     If patch indicates that patchlevel is the wrong version, you may need
  64.     to apply one or more previous patches, or the patch may already
  65.     have been applied.  See the patchlevel.h file to find out what has or
  66.     has not been applied.  In any event, don't continue with the patch.
  67.  
  68.     If you are missing previous patches they can be obtained from me:
  69.  
  70.         Raphael Manfredi <ram@eiffel.com>
  71.  
  72.     If you send a mail message of the following form it will greatly speed
  73.     processing:
  74.  
  75.         Subject: Command
  76.         @SH mailpatch PATH kit 2.0 LIST
  77.                ^ note the c
  78.  
  79.     where PATH is a return path FROM ME TO YOU either in Internet notation,
  80.     or in bang notation from some well-known host, and LIST is the number
  81.     of one or more patches you need, separated by spaces, commas, and/or
  82.     hyphens.  Saying 35- says everything from 35 to the end.
  83.  
  84.     To get some more detailed instructions, send me the following mail:
  85.  
  86.         Subject: Command
  87.         @SH mailhelp PATH
  88.  
  89.  
  90. Index: patchlevel.h
  91. Prereq: 12
  92. 2c2
  93. < #define PATCHLEVEL 12
  94. ---
  95. > #define PATCHLEVEL 13
  96.  
  97. Index: shar/rshar.SH
  98. Prereq: 2.0.1.1
  99. *** shar/rshar.SH.old    Mon Jan 13 14:27:05 1992
  100. --- shar/rshar.SH    Mon Jan 13 14:27:06 1992
  101. ***************
  102. *** 17,25 ****
  103.   $startsh
  104.   # (c) Raphael Manfredi, December 25th 1991
  105.   
  106. ! # $Id: rshar.SH,v 2.0.1.1 92/01/11 19:23:24 ram Exp $
  107.   #
  108.   # $Log:    rshar.SH,v $
  109.   # Revision 2.0.1.1  92/01/11  19:23:24  ram
  110.   # patch11: created
  111.   # 
  112. --- 17,31 ----
  113.   $startsh
  114.   # (c) Raphael Manfredi, December 25th 1991
  115.   
  116. ! # $Id: rshar.SH,v 2.0.1.2 92/01/13 14:26:20 ram Exp $
  117.   #
  118.   # $Log:    rshar.SH,v $
  119. + # Revision 2.0.1.2  92/01/13  14:26:20  ram
  120. + # patch13: fixed option parsing code
  121. + # patch13: the archive extraction now returns meaningful exit code
  122. + # patch13: from Jaap Vermeulen <jaap@sequent.com>
  123. + # patch13: there is now a space between file size and "characters"
  124. + # 
  125.   # Revision 2.0.1.1  92/01/11  19:23:24  ram
  126.   # patch11: created
  127.   # 
  128. ***************
  129. *** 38,46 ****
  130.   number=1
  131.   
  132.   # Option parsing
  133. ! for i in $*
  134.   do
  135. !     case "$i" in
  136.       -k) shift
  137.           max=$1
  138.           shift
  139. --- 44,52 ----
  140.   number=1
  141.   
  142.   # Option parsing
  143. ! while test $# -gt 0
  144.   do
  145. !     case "$1" in
  146.       -k) shift
  147.           max=$1
  148.           shift
  149. ***************
  150. *** 49,54 ****
  151. --- 55,63 ----
  152.           number=$1
  153.           shift
  154.           ;;
  155. +     --) shift
  156. +         break
  157. +         ;;
  158.       -*) echo "unkown option $1"
  159.           exit 1
  160.           ;;
  161. ***************
  162. *** 74,89 ****
  163.   else
  164.       echo "echo '          \"shar: End of archive $number (of $max).\"'"
  165.   fi
  166.   
  167. ! for i
  168.   do
  169.       # Do not extract file if one with the same name already exists
  170.       echo "if test -f '$i' -a \"\${1}\" != \"-c\"; then"
  171.       echo "    echo \"shar: Will not clobber existing file '$i'\""
  172.       echo "else"
  173. !     size=`wc -c < $i`
  174. !     size=`expr "$size" : '\ *\(.*\)'`
  175. !     echo "    echo \"shar: Extracting '$i' (${size}characters)\""
  176.       # Insert X at the front, in case END_OF_FILE appears in the file
  177.       echo "    sed 's/^X//' > $i << 'END_OF_FILE'"
  178.       sed 's/^/X/' $i
  179. --- 83,100 ----
  180.   else
  181.       echo "echo '          \"shar: End of archive $number (of $max).\"'"
  182.   fi
  183. + echo "exitcode=0"
  184.   
  185. ! for i in $*
  186.   do
  187.       # Do not extract file if one with the same name already exists
  188.       echo "if test -f '$i' -a \"\${1}\" != \"-c\"; then"
  189.       echo "    echo \"shar: Will not clobber existing file '$i'\""
  190. +     echo "    exitcode=1"
  191.       echo "else"
  192. !     set x `wc -c < $i`
  193. !     size=$2
  194. !     echo "    echo \"shar: Extracting '$i' ($size characters)\""
  195.       # Insert X at the front, in case END_OF_FILE appears in the file
  196.       echo "    sed 's/^X//' > $i << 'END_OF_FILE'"
  197.       sed 's/^/X/' $i
  198. ***************
  199. *** 95,100 ****
  200. --- 106,112 ----
  201.       # verify length
  202.       echo "    if test $size -ne \`wc -c < '$i'\`; then"
  203.       echo "        echo \"shar: '$i' unpacked with wrong size!\""
  204. +     echo "        exitcode=1
  205.       echo "    fi"
  206.       echo "    # end of '$i'"
  207.       echo "fi"
  208. ***************
  209. *** 127,133 ****
  210.   fi
  211.   
  212.   # Someone might mail this :-) so skip signature
  213. ! echo "exit 0"
  214.   !NO!SUBS!
  215.   chmod 755 rshar
  216.   $eunicefix rshar
  217. --- 139,145 ----
  218.   fi
  219.   
  220.   # Someone might mail this :-) so skip signature
  221. ! echo "exit \$exitcode"
  222.   !NO!SUBS!
  223.   chmod 755 rshar
  224.   $eunicefix rshar
  225.  
  226. Index: kit/kit.SH
  227. Prereq: 2.0.1.7
  228. *** kit/kit.SH.old    Mon Jan 13 14:26:38 1992
  229. --- kit/kit.SH    Mon Jan 13 14:26:39 1992
  230. ***************
  231. *** 26,34 ****
  232.   !GROK!THIS!
  233.   $spitshell >>kit <<'!NO!SUBS!'
  234.   
  235. ! # $Id: kit.SH,v 2.0.1.7 92/01/11 19:17:20 ram Exp $
  236.   #
  237.   # $Log:    kit.SH,v $
  238.   # Revision 2.0.1.7  92/01/11  19:17:20  ram
  239.   # patch11: now uses makeshar when cshar is not installed
  240.   # 
  241. --- 26,37 ----
  242.   !GROK!THIS!
  243.   $spitshell >>kit <<'!NO!SUBS!'
  244.   
  245. ! # $Id: kit.SH,v 2.0.1.8 92/01/13 14:13:59 ram Exp $
  246.   #
  247.   # $Log:    kit.SH,v $
  248. + # Revision 2.0.1.8  92/01/13  14:13:59  ram
  249. + # patch13: fixed the option parsing code
  250. + # 
  251.   # Revision 2.0.1.7  92/01/11  19:17:20  ram
  252.   # patch11: now uses makeshar when cshar is not installed
  253.   # 
  254. ***************
  255. *** 108,116 ****
  256.   exit 1
  257.   '
  258.   
  259. ! for i in $*
  260.   do
  261. !     case $i in 
  262.       -M) shift
  263.           if test -f minikit; then
  264.               if test -f MINIKIT; then
  265. --- 111,119 ----
  266.   exit 1
  267.   '
  268.   
  269. ! while test $# -gt 0
  270.   do
  271. !     case "$1" in 
  272.       -M) shift
  273.           if test -f minikit; then
  274.               if test -f MINIKIT; then
  275. ***************
  276. *** 174,179 ****
  277. --- 177,185 ----
  278.           exit 0
  279.           ;;
  280.       -h) eval $usage
  281. +         ;;
  282. +     --) shift
  283. +         break
  284.           ;;
  285.       -*) echo "unkown option $1"
  286.           eval $usage
  287.  
  288. Index: man/kit.SH
  289. Prereq: 2.0.1.6
  290. *** man/kit.SH.old    Mon Jan 13 14:26:57 1992
  291. --- man/kit.SH    Mon Jan 13 14:26:58 1992
  292. ***************
  293. *** 18,26 ****
  294.   .TH KIT $manext ram
  295.   ''' @(#) Manual page for mailing kit -- (c) ram July 1990
  296.   '''
  297. ! ''' $Id: kit.SH,v 2.0.1.6 92/01/11 19:22:08 ram Exp $
  298.   '''
  299.   ''' $Log:    kit.SH,v $
  300.   ''' Revision 2.0.1.6  92/01/11  19:22:08  ram
  301.   ''' patch11: the .so directive was made relative to make man happy
  302.   ''' patch11: documents badtar and cshar-emulating scripts
  303. --- 18,29 ----
  304.   .TH KIT $manext ram
  305.   ''' @(#) Manual page for mailing kit -- (c) ram July 1990
  306.   '''
  307. ! ''' $Id: kit.SH,v 2.0.1.7 92/01/13 14:21:42 ram Exp $
  308.   '''
  309.   ''' $Log:    kit.SH,v $
  310. + ''' Revision 2.0.1.7  92/01/13  14:21:42  ram
  311. + ''' patch13: the built-in unshar in unkit may now be used alone
  312. + ''' 
  313.   ''' Revision 2.0.1.6  92/01/11  19:22:08  ram
  314.   ''' patch11: the .so directive was made relative to make man happy
  315.   ''' patch11: documents badtar and cshar-emulating scripts
  316. ***************
  317. *** 157,163 ****
  318.   .PP
  319.   If you want to know what \fIunkit\fR will create without actually
  320.   doing it, use the \fB\-l\fR option. With this option, \fB\-r\fR is
  321. ! ignored.
  322.   .PP
  323.   For all of these commands, option \fB\-V\fR prints the version
  324.   number with the current patch level and exits, while \fB\-h\fR gives
  325. --- 160,168 ----
  326.   .PP
  327.   If you want to know what \fIunkit\fR will create without actually
  328.   doing it, use the \fB\-l\fR option. With this option, \fB\-r\fR is
  329. ! ignored. You may also use \fIunkit\fR in place of \fIunshar\fR: it will
  330. ! stop after having unpacked the shell archives if it does not detect any
  331. ! kit file.
  332.   .PP
  333.   For all of these commands, option \fB\-V\fR prints the version
  334.   number with the current patch level and exits, while \fB\-h\fR gives
  335.  
  336. Index: kit/unkit.SH
  337. Prereq: 2.0.1.8
  338. *** kit/unkit.SH.old    Mon Jan 13 14:26:50 1992
  339. --- kit/unkit.SH    Mon Jan 13 14:26:51 1992
  340. ***************
  341. *** 19,27 ****
  342.   # @(#) (c) E. Mogenet April 1990
  343.   # @(#) (c) R. Manfredi, 1990 1991
  344.   
  345. ! # $Id: unkit.SH,v 2.0.1.8 92/01/11 19:20:05 ram Exp $
  346.   #
  347.   # $Log:    unkit.SH,v $
  348.   # Revision 2.0.1.8  92/01/11  19:20:05  ram
  349.   # patch11: now knows about badtar
  350.   # patch11: added -b option to force use of badtar
  351. --- 19,32 ----
  352.   # @(#) (c) E. Mogenet April 1990
  353.   # @(#) (c) R. Manfredi, 1990 1991
  354.   
  355. ! # $Id: unkit.SH,v 2.0.1.9 92/01/13 14:20:37 ram Exp $
  356.   #
  357.   # $Log:    unkit.SH,v $
  358. + # Revision 2.0.1.9  92/01/13  14:20:37  ram
  359. + # patch13: fixed the option parsing code
  360. + # patch13: unkit may be used to actually do an unshar
  361. + # patch13: from Jaap Vermeulen <jaap@sequent.com>
  362. + # 
  363.   # Revision 2.0.1.8  92/01/11  19:20:05  ram
  364.   # patch11: now knows about badtar
  365.   # patch11: added -b option to force use of badtar
  366. ***************
  367. *** 105,113 ****
  368.   '
  369.   
  370.   # Option parsing
  371. ! for i in $*
  372.   do
  373. !     case $i in
  374.       -p) preserve=yes
  375.           shift;;
  376.       -r) if test $tar_opt = xvof
  377. --- 110,118 ----
  378.   '
  379.   
  380.   # Option parsing
  381. ! while test $# -gt 0
  382.   do
  383. !     case "$1" in
  384.       -p) preserve=yes
  385.           shift;;
  386.       -r) if test $tar_opt = xvof
  387. ***************
  388. *** 123,128 ****
  389. --- 128,136 ----
  390.           shift;;
  391.       -b) usebtar='true'
  392.           shift;;
  393. +     --) shift
  394. +         break
  395. +         ;;
  396.       -*) echo "Unknown option $i"
  397.           eval $usage;;
  398.       *) break;;
  399. ***************
  400. *** 160,165 ****
  401. --- 168,176 ----
  402.   if test -f z[ace][gbc].ba.aa
  403.   then
  404.       decoding=atob
  405. + else
  406. +     # Unkit was used whilst unshar was intended
  407. +     exit 0
  408.   fi
  409.   if test -f zcb.*.aa
  410.   then
  411.  
  412. Index: shar/makeshar.SH
  413. Prereq: 2.0.1.1
  414. *** shar/makeshar.SH.old    Mon Jan 13 14:27:01 1992
  415. --- shar/makeshar.SH    Mon Jan 13 14:27:02 1992
  416. ***************
  417. *** 17,25 ****
  418.   $startsh
  419.   # (c) Raphael Manfredi, December 25th 1991
  420.   
  421. ! # $Id: makeshar.SH,v 2.0.1.1 92/01/11 19:23:16 ram Exp $
  422.   #
  423.   # $Log:    makeshar.SH,v $
  424.   # Revision 2.0.1.1  92/01/11  19:23:16  ram
  425.   # patch11: created
  426.   # 
  427. --- 17,29 ----
  428.   $startsh
  429.   # (c) Raphael Manfredi, December 25th 1991
  430.   
  431. ! # $Id: makeshar.SH,v 2.0.1.2 92/01/13 14:22:25 ram Exp $
  432.   #
  433.   # $Log:    makeshar.SH,v $
  434. + # Revision 2.0.1.2  92/01/13  14:22:25  ram
  435. + # patch13: fixed option parsing code
  436. + # patch13: protected arguments given to rshar
  437. + # 
  438.   # Revision 2.0.1.1  92/01/11  19:23:16  ram
  439.   # patch11: created
  440.   # 
  441. ***************
  442. *** 39,45 ****
  443.   partname=Part
  444.   
  445.   # Option parsing
  446. ! for i in $*
  447.   do
  448. !     case "$i" in
  449.       -n) shift
  450. --- 43,49 ----
  451.   partname=Part
  452.   
  453.   # Option parsing
  454. ! while test $# -gt 0
  455.   do
  456. !     case "$1" in
  457.       -n) shift
  458. ***************
  459. *** 49,54 ****
  460. --- 53,61 ----
  461.       -*) echo "unknown option $i"
  462.           exit 1
  463.           ;;
  464. +     --) shift
  465. +         break
  466. +         ;;
  467.       *) break
  468.           ;;
  469.       esac
  470. ***************
  471. *** 119,125 ****
  472.               name=${partname}$i
  473.           fi
  474.           echo "Packing kit $i..."
  475. !         $libdir/rshar -k $max -n $i $first $last > $name
  476.           i=`expr $i + 1`
  477.       done
  478.   )
  479. --- 126,132 ----
  480.               name=${partname}$i
  481.           fi
  482.           echo "Packing kit $i..."
  483. !         $libdir/rshar -k $max -n $i -- $first $last > $name
  484.           i=`expr $i + 1`
  485.       done
  486.   )
  487.  
  488. Index: kit/mailkit.SH
  489. Prereq: 2.0.1.5
  490. *** kit/mailkit.SH.old    Mon Jan 13 14:26:44 1992
  491. --- kit/mailkit.SH    Mon Jan 13 14:26:45 1992
  492. ***************
  493. *** 18,26 ****
  494.   # @(#) Mailer for kit files
  495.   # @(#) (c) R. Manfredi, 1990 1991
  496.   
  497. ! # $Id: mailkit.SH,v 2.0.1.5 92/01/11 19:19:15 ram Exp $
  498.   #
  499.   # $Log:    mailkit.SH,v $
  500.   # Revision 2.0.1.5  92/01/11  19:19:15  ram
  501.   # patch11: the leading 'startsh' configuration variable was missing
  502.   # patch11: reported by Michael Fischer <fischer-michael@cs.yale.edu>
  503. --- 18,29 ----
  504.   # @(#) Mailer for kit files
  505.   # @(#) (c) R. Manfredi, 1990 1991
  506.   
  507. ! # $Id: mailkit.SH,v 2.0.1.6 92/01/13 14:14:21 ram Exp $
  508.   #
  509.   # $Log:    mailkit.SH,v $
  510. + # Revision 2.0.1.6  92/01/13  14:14:21  ram
  511. + # patch13: fixed the option parsing code
  512. + # 
  513.   # Revision 2.0.1.5  92/01/11  19:19:15  ram
  514.   # patch11: the leading 'startsh' configuration variable was missing
  515.   # patch11: reported by Michael Fischer <fischer-michael@cs.yale.edu>
  516. ***************
  517. *** 84,92 ****
  518.   '
  519.   
  520.   # Argument parsing
  521. ! for i in $*
  522.   do
  523. !     case $i in
  524.       -V) echo "mailkit $version PL$pl"
  525.           exit 0
  526.           ;;
  527. --- 87,95 ----
  528.   '
  529.   
  530.   # Argument parsing
  531. ! while test $# -gt 0
  532.   do
  533. !     case "$1" in
  534.       -V) echo "mailkit $version PL$pl"
  535.           exit 0
  536.           ;;
  537. ***************
  538. *** 118,123 ****
  539. --- 121,129 ----
  540.       -F)    feed=yes
  541.           added=no
  542.           shift
  543. +         ;;
  544. +     --) shift
  545. +         break
  546.           ;;
  547.       -*) echo "unknown option $1"
  548.           eval $usage
  549.  
  550. Index: README
  551. *** README.old    Mon Jan 13 14:26:29 1992
  552. --- README    Mon Jan 13 14:26:31 1992
  553. ***************
  554. *** 89,93 ****
  555. --- 89,95 ----
  556.   The criticism of Tim Kuehn <timk@wynnds.xenitec.on.ca> was also much
  557.   appreciated.
  558.   
  559. + I am especially grateful to Jaap Vermeulen <jaap@sequent.com> for his
  560. + critical bug reports and suggestions.
  561.   
  562.       Raphael Manfredi <ram@eiffel.com>
  563.  
  564. *** End of Patch 13 ***
  565.