home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.sources.unix
- From: ram@eiffel.com (Raphael Manfredi)
- Subject: v26i010: kit - the ultimate mailing kit, Patch13
- Sender: unix-sources-moderator@pa.dec.com
- Approved: vixie@pa.dec.com
-
- Submitted-By: ram@eiffel.com (Raphael Manfredi)
- Posting-Number: Volume 26, Issue 10
- Archive-Name: kit/pch13
-
-
- [The latest patch for kit version 2.0 is #14.]
-
- System: kit version 2.0
- Patch #: 13
- Priority: HIGH
- Subject: many thanks to Jaap Vermeulen <jaap@sequent.com>
- Subject: fixed the option parsing code
- Subject: unkit may be used to actually do an unshar
- Subject: the built-in unshar in unkit may now be used alone
- Subject: fixed option parsing code
- Subject: protected arguments given to rshar
- Subject: the archive extraction now returns meaningful exit code
- Subject: there is now a space between file size and "characters"
- Date: Mon Jan 13 14:27:10 PST 1992
- From: Raphael Manfredi <ram@eiffel.com>
-
- Description:
- I would like to express my thanks to Jaap Vermeulen <jaap@sequent.com>.
- This patch was issued after a short e-mail exchange when I realized that
- some edges could be polished and the (last, hopefully) bug was fixed.
-
- The option parsing code was wrong!! Yes. Sorry. It worked fine on my
- machine and I havn't heard any complaint regarding that particular
- point, but nonetheless, it was wrong.
-
- Unkit may be used to actually do an unshar. For those who do not have
- 'unshar', you may now use 'unkit'. The script will stop after having
- run the shell archives if it does not detect any kit file.
-
- I protected the arguments given to rshar, just in case one file is
- named '-n' or '-k'.
-
- The archive extraction now returns meaningful exit code. If an extraction
- failed or a file was not extracted because it would have overwritten an
- existing file, then the exit status is 1.
-
- There is now a space between file size and "characters". Some 'wc' add
- a trailing space, some don't. I'm now relying on the shell to do the
- job for me (i.e. to remove the tabs and spaces).
-
-
- 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 <thisarticle".
- If you don't have the patch program, apply the following by hand,
- or get patch (version 2.0, latest patchlevel).
-
- After patching:
- Configure -d
- make
- make install
-
- If patch indicates that patchlevel is the wrong version, you may need
- to apply one or more previous patches, or the patch may already
- have been applied. See the patchlevel.h file to find out what has or
- has not been applied. In any event, don't continue with the patch.
-
- If you are missing previous patches they can be obtained from me:
-
- Raphael Manfredi <ram@eiffel.com>
-
- 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: 12
- 2c2
- < #define PATCHLEVEL 12
- ---
- > #define PATCHLEVEL 13
-
- Index: shar/rshar.SH
- Prereq: 2.0.1.1
- *** shar/rshar.SH.old Mon Jan 13 14:27:05 1992
- --- shar/rshar.SH Mon Jan 13 14:27:06 1992
- ***************
- *** 17,25 ****
- $startsh
- # (c) Raphael Manfredi, December 25th 1991
-
- ! # $Id: rshar.SH,v 2.0.1.1 92/01/11 19:23:24 ram Exp $
- #
- # $Log: rshar.SH,v $
- # Revision 2.0.1.1 92/01/11 19:23:24 ram
- # patch11: created
- #
- --- 17,31 ----
- $startsh
- # (c) Raphael Manfredi, December 25th 1991
-
- ! # $Id: rshar.SH,v 2.0.1.2 92/01/13 14:26:20 ram Exp $
- #
- # $Log: rshar.SH,v $
- + # Revision 2.0.1.2 92/01/13 14:26:20 ram
- + # patch13: fixed option parsing code
- + # patch13: the archive extraction now returns meaningful exit code
- + # patch13: from Jaap Vermeulen <jaap@sequent.com>
- + # patch13: there is now a space between file size and "characters"
- + #
- # Revision 2.0.1.1 92/01/11 19:23:24 ram
- # patch11: created
- #
- ***************
- *** 38,46 ****
- number=1
-
- # Option parsing
- ! for i in $*
- do
- ! case "$i" in
- -k) shift
- max=$1
- shift
- --- 44,52 ----
- number=1
-
- # Option parsing
- ! while test $# -gt 0
- do
- ! case "$1" in
- -k) shift
- max=$1
- shift
- ***************
- *** 49,54 ****
- --- 55,63 ----
- number=$1
- shift
- ;;
- + --) shift
- + break
- + ;;
- -*) echo "unkown option $1"
- exit 1
- ;;
- ***************
- *** 74,89 ****
- 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
- --- 83,100 ----
- else
- echo "echo ' \"shar: End of archive $number (of $max).\"'"
- fi
- + echo "exitcode=0"
-
- ! for i in $*
- 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 " exitcode=1"
- echo "else"
- ! set x `wc -c < $i`
- ! size=$2
- ! 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
- ***************
- *** 95,100 ****
- --- 106,112 ----
- # verify length
- echo " if test $size -ne \`wc -c < '$i'\`; then"
- echo " echo \"shar: '$i' unpacked with wrong size!\""
- + echo " exitcode=1
- echo " fi"
- echo " # end of '$i'"
- echo "fi"
- ***************
- *** 127,133 ****
- fi
-
- # Someone might mail this :-) so skip signature
- ! echo "exit 0"
- !NO!SUBS!
- chmod 755 rshar
- $eunicefix rshar
- --- 139,145 ----
- fi
-
- # Someone might mail this :-) so skip signature
- ! echo "exit \$exitcode"
- !NO!SUBS!
- chmod 755 rshar
- $eunicefix rshar
-
- Index: kit/kit.SH
- Prereq: 2.0.1.7
- *** kit/kit.SH.old Mon Jan 13 14:26:38 1992
- --- kit/kit.SH Mon Jan 13 14:26:39 1992
- ***************
- *** 26,34 ****
- !GROK!THIS!
- $spitshell >>kit <<'!NO!SUBS!'
-
- ! # $Id: kit.SH,v 2.0.1.7 92/01/11 19:17:20 ram Exp $
- #
- # $Log: kit.SH,v $
- # Revision 2.0.1.7 92/01/11 19:17:20 ram
- # patch11: now uses makeshar when cshar is not installed
- #
- --- 26,37 ----
- !GROK!THIS!
- $spitshell >>kit <<'!NO!SUBS!'
-
- ! # $Id: kit.SH,v 2.0.1.8 92/01/13 14:13:59 ram Exp $
- #
- # $Log: kit.SH,v $
- + # Revision 2.0.1.8 92/01/13 14:13:59 ram
- + # patch13: fixed the option parsing code
- + #
- # Revision 2.0.1.7 92/01/11 19:17:20 ram
- # patch11: now uses makeshar when cshar is not installed
- #
- ***************
- *** 108,116 ****
- exit 1
- '
-
- ! for i in $*
- do
- ! case $i in
- -M) shift
- if test -f minikit; then
- if test -f MINIKIT; then
- --- 111,119 ----
- exit 1
- '
-
- ! while test $# -gt 0
- do
- ! case "$1" in
- -M) shift
- if test -f minikit; then
- if test -f MINIKIT; then
- ***************
- *** 174,179 ****
- --- 177,185 ----
- exit 0
- ;;
- -h) eval $usage
- + ;;
- + --) shift
- + break
- ;;
- -*) echo "unkown option $1"
- eval $usage
-
- Index: man/kit.SH
- Prereq: 2.0.1.6
- *** man/kit.SH.old Mon Jan 13 14:26:57 1992
- --- man/kit.SH Mon Jan 13 14:26:58 1992
- ***************
- *** 18,26 ****
- .TH KIT $manext ram
- ''' @(#) Manual page for mailing kit -- (c) ram July 1990
- '''
- ! ''' $Id: kit.SH,v 2.0.1.6 92/01/11 19:22:08 ram Exp $
- '''
- ''' $Log: kit.SH,v $
- ''' Revision 2.0.1.6 92/01/11 19:22:08 ram
- ''' patch11: the .so directive was made relative to make man happy
- ''' patch11: documents badtar and cshar-emulating scripts
- --- 18,29 ----
- .TH KIT $manext ram
- ''' @(#) Manual page for mailing kit -- (c) ram July 1990
- '''
- ! ''' $Id: kit.SH,v 2.0.1.7 92/01/13 14:21:42 ram Exp $
- '''
- ''' $Log: kit.SH,v $
- + ''' Revision 2.0.1.7 92/01/13 14:21:42 ram
- + ''' patch13: the built-in unshar in unkit may now be used alone
- + '''
- ''' Revision 2.0.1.6 92/01/11 19:22:08 ram
- ''' patch11: the .so directive was made relative to make man happy
- ''' patch11: documents badtar and cshar-emulating scripts
- ***************
- *** 157,163 ****
- .PP
- If you want to know what \fIunkit\fR will create without actually
- doing it, use the \fB\-l\fR option. With this option, \fB\-r\fR is
- ! ignored.
- .PP
- For all of these commands, option \fB\-V\fR prints the version
- number with the current patch level and exits, while \fB\-h\fR gives
- --- 160,168 ----
- .PP
- If you want to know what \fIunkit\fR will create without actually
- doing it, use the \fB\-l\fR option. With this option, \fB\-r\fR is
- ! ignored. You may also use \fIunkit\fR in place of \fIunshar\fR: it will
- ! stop after having unpacked the shell archives if it does not detect any
- ! kit file.
- .PP
- For all of these commands, option \fB\-V\fR prints the version
- number with the current patch level and exits, while \fB\-h\fR gives
-
- Index: kit/unkit.SH
- Prereq: 2.0.1.8
- *** kit/unkit.SH.old Mon Jan 13 14:26:50 1992
- --- kit/unkit.SH Mon Jan 13 14:26:51 1992
- ***************
- *** 19,27 ****
- # @(#) (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
- --- 19,32 ----
- # @(#) (c) E. Mogenet April 1990
- # @(#) (c) R. Manfredi, 1990 1991
-
- ! # $Id: unkit.SH,v 2.0.1.9 92/01/13 14:20:37 ram Exp $
- #
- # $Log: unkit.SH,v $
- + # Revision 2.0.1.9 92/01/13 14:20:37 ram
- + # patch13: fixed the option parsing code
- + # patch13: unkit may be used to actually do an unshar
- + # patch13: from Jaap Vermeulen <jaap@sequent.com>
- + #
- # 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
- ***************
- *** 105,113 ****
- '
-
- # Option parsing
- ! for i in $*
- do
- ! case $i in
- -p) preserve=yes
- shift;;
- -r) if test $tar_opt = xvof
- --- 110,118 ----
- '
-
- # Option parsing
- ! while test $# -gt 0
- do
- ! case "$1" in
- -p) preserve=yes
- shift;;
- -r) if test $tar_opt = xvof
- ***************
- *** 123,128 ****
- --- 128,136 ----
- shift;;
- -b) usebtar='true'
- shift;;
- + --) shift
- + break
- + ;;
- -*) echo "Unknown option $i"
- eval $usage;;
- *) break;;
- ***************
- *** 160,165 ****
- --- 168,176 ----
- if test -f z[ace][gbc].ba.aa
- then
- decoding=atob
- + else
- + # Unkit was used whilst unshar was intended
- + exit 0
- fi
- if test -f zcb.*.aa
- then
-
- Index: shar/makeshar.SH
- Prereq: 2.0.1.1
- *** shar/makeshar.SH.old Mon Jan 13 14:27:01 1992
- --- shar/makeshar.SH Mon Jan 13 14:27:02 1992
- ***************
- *** 17,25 ****
- $startsh
- # (c) Raphael Manfredi, December 25th 1991
-
- ! # $Id: makeshar.SH,v 2.0.1.1 92/01/11 19:23:16 ram Exp $
- #
- # $Log: makeshar.SH,v $
- # Revision 2.0.1.1 92/01/11 19:23:16 ram
- # patch11: created
- #
- --- 17,29 ----
- $startsh
- # (c) Raphael Manfredi, December 25th 1991
-
- ! # $Id: makeshar.SH,v 2.0.1.2 92/01/13 14:22:25 ram Exp $
- #
- # $Log: makeshar.SH,v $
- + # Revision 2.0.1.2 92/01/13 14:22:25 ram
- + # patch13: fixed option parsing code
- + # patch13: protected arguments given to rshar
- + #
- # Revision 2.0.1.1 92/01/11 19:23:16 ram
- # patch11: created
- #
- ***************
- *** 39,45 ****
- partname=Part
-
- # Option parsing
- ! for i in $*
- do
- ! case "$i" in
- -n) shift
- --- 43,49 ----
- partname=Part
-
- # Option parsing
- ! while test $# -gt 0
- do
- ! case "$1" in
- -n) shift
- ***************
- *** 49,54 ****
- --- 53,61 ----
- -*) echo "unknown option $i"
- exit 1
- ;;
- + --) shift
- + break
- + ;;
- *) break
- ;;
- esac
- ***************
- *** 119,125 ****
- name=${partname}$i
- fi
- echo "Packing kit $i..."
- ! $libdir/rshar -k $max -n $i $first $last > $name
- i=`expr $i + 1`
- done
- )
- --- 126,132 ----
- name=${partname}$i
- fi
- echo "Packing kit $i..."
- ! $libdir/rshar -k $max -n $i -- $first $last > $name
- i=`expr $i + 1`
- done
- )
-
- Index: kit/mailkit.SH
- Prereq: 2.0.1.5
- *** kit/mailkit.SH.old Mon Jan 13 14:26:44 1992
- --- kit/mailkit.SH Mon Jan 13 14:26:45 1992
- ***************
- *** 18,26 ****
- # @(#) Mailer for kit files
- # @(#) (c) R. Manfredi, 1990 1991
-
- ! # $Id: mailkit.SH,v 2.0.1.5 92/01/11 19:19:15 ram Exp $
- #
- # $Log: mailkit.SH,v $
- # Revision 2.0.1.5 92/01/11 19:19:15 ram
- # patch11: the leading 'startsh' configuration variable was missing
- # patch11: reported by Michael Fischer <fischer-michael@cs.yale.edu>
- --- 18,29 ----
- # @(#) Mailer for kit files
- # @(#) (c) R. Manfredi, 1990 1991
-
- ! # $Id: mailkit.SH,v 2.0.1.6 92/01/13 14:14:21 ram Exp $
- #
- # $Log: mailkit.SH,v $
- + # Revision 2.0.1.6 92/01/13 14:14:21 ram
- + # patch13: fixed the option parsing code
- + #
- # Revision 2.0.1.5 92/01/11 19:19:15 ram
- # patch11: the leading 'startsh' configuration variable was missing
- # patch11: reported by Michael Fischer <fischer-michael@cs.yale.edu>
- ***************
- *** 84,92 ****
- '
-
- # Argument parsing
- ! for i in $*
- do
- ! case $i in
- -V) echo "mailkit $version PL$pl"
- exit 0
- ;;
- --- 87,95 ----
- '
-
- # Argument parsing
- ! while test $# -gt 0
- do
- ! case "$1" in
- -V) echo "mailkit $version PL$pl"
- exit 0
- ;;
- ***************
- *** 118,123 ****
- --- 121,129 ----
- -F) feed=yes
- added=no
- shift
- + ;;
- + --) shift
- + break
- ;;
- -*) echo "unknown option $1"
- eval $usage
-
- Index: README
- *** README.old Mon Jan 13 14:26:29 1992
- --- README Mon Jan 13 14:26:31 1992
- ***************
- *** 89,93 ****
- --- 89,95 ----
- The criticism of Tim Kuehn <timk@wynnds.xenitec.on.ca> was also much
- appreciated.
-
- + I am especially grateful to Jaap Vermeulen <jaap@sequent.com> for his
- + critical bug reports and suggestions.
-
- Raphael Manfredi <ram@eiffel.com>
-
- *** End of Patch 13 ***
-