home *** CD-ROM | disk | FTP | other *** search
Text File | 1993-05-04 | 35.3 KB | 1,187 lines |
- Newsgroups: comp.sources.unix
- From: ram@acri.fr (Raphael Manfredi)
- Subject: v26i221: kit - the ultimate mailing kit, Patch16
- Sender: unix-sources-moderator@efficacy.home.vix.com
- Approved: WhoAmI@efficacy.home.vix.com
-
- Submitted-By: ram@acri.fr (Raphael Manfredi)
- Posting-Number: Volume 26, Issue 221
- Archive-Name: kit/pch16
-
- [The latest patch for kit version 2.0 is #28.]
-
- System: kit version 2.0
- Patch #: 16
- Priority: LOW
- Subject: fixed incorrect extraction message for badtar manpage
- Subject: minor typo fix in mkdir_p in install.SH
- Subject: new range expansion library script
- Subject: new option -S to set maximum part size
- Subject: there can now be multiple occurences of -l
- Subject: -p is now the default option unless -c is used
- Subject: kit now invokes mailkit with -c to force clean up
- Subject: mailkit asks for unsent part disposal when needed
- Subject: now pays attention to EDITOR and MAILER env vars
- Subject: new -r option to specify range of parts to be sent
- Subject: added -c option to force cleanup of parts
- Subject: documents new -r option for mailkit and -S for kit
- Subject: added example using mailkit -r
- Subject: maximum part size can now be specified via -s
- Date: Sat May 2 14:21:15 PDT 1992
- From: Raphael Manfredi <ram@eiffel.com>
-
- Description:
- Kit now has a new option -S to set maximum part size. This feature
- has been requested by Christian Bertin <bertin@acri.fr>.
-
- There can now be multiple occurences of -l in mailkit command line
- to include addresses from more than one file.
-
- Kit now invokes mailkit with -c to force clean up. Indeed, the -p option
- is now the default when -c is not used. This means mailkit will not
- remove files sent by default when invoked from a shell. Moreover,
- mailkit now asks for unsent part disposal when needed (shall they be
- removed or kept for later perusal?).
-
- Mailkit now pays attention to EDITOR and MAILER env vars. Another
- feature suggested by Christian Bertin.
-
- Maikit also has a new -r option to specify range of parts to be sent.
- For instance, 'mailkit -r 1,5-7,10,11,13 dist ram@eiffel.com' would
- send me part 1, 5 through 7, and 10, 11 and 13 of a distribution called
- 'dist'. The range expansion is handled through a new library script.
-
- 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: 15
- 2c2
- < #define PATCHLEVEL 15
- ---
- > #define PATCHLEVEL 16
-
- Index: kit/kit.SH
- Prereq: 2.0.1.9
- *** kit/kit.SH.old Sat May 2 14:20:35 1992
- --- kit/kit.SH Sat May 2 14:20:37 1992
- ***************
- *** 26,34 ****
- !GROK!THIS!
- $spitshell >>kit <<'!NO!SUBS!'
-
- ! # $Id: kit.SH,v 2.0.1.9 92/04/20 17:35:03 ram Exp $
- #
- # $Log: kit.SH,v $
- # Revision 2.0.1.9 92/04/20 17:35:03 ram
- # patch15: added support for -a option
- # patch15: stamping now includes user and host infos
- --- 26,37 ----
- !GROK!THIS!
- $spitshell >>kit <<'!NO!SUBS!'
-
- ! # $Id: kit.SH,v 2.0.1.10 92/05/02 14:13:45 ram Exp $
- #
- # $Log: kit.SH,v $
- + # Revision 2.0.1.10 92/05/02 14:13:45 ram
- + # patch16: new option -S to set maximum part size
- + #
- # Revision 2.0.1.9 92/04/20 17:35:03 ram
- # patch15: added support for -a option
- # patch15: stamping now includes user and host infos
- ***************
- *** 75,80 ****
- --- 78,85 ----
- mode="zag" # Mode is the 'A' part of the name
- code="ba" # Code is the 'B' part of the name
- mailkit=mailkit # Mailing program to use with kit
- + maxsize=50000 # Default maximum part size in bytes
- + maxvalue=$maxsize # Actual requested size
- invoke=no # Do we have to invoke mailkit ?
- tmpfile=/tmp/Kds$$ # Temporary file
- tmpdir="." # Temporary directory used
- ***************
- *** 95,102 ****
-
- # Old Bourne shells do not have functions
- usage='
- ! echo "Usage: kit [-BEFHMVXefhpx] [-a address] [-d dir] [-k key] [-m address]";
- ! echo " "" "" "" "" "" "" [-n basename] [-l file] [-s name] dirs | files";
- echo " "" -B : use btoa encoding (default).";
- echo " "" -E : edit instructions for part #0 (passed to mailkit).";
- echo " "" -F : feed instructions from stdin to part #0 (passed to mailkit).";
- --- 100,107 ----
-
- # Old Bourne shells do not have functions
- usage='
- ! echo "Usage: kit [-BEFHMVXefhpx] [-S size] [-a address] [-d dir] [-k key]";
- ! echo " "" "" "" "" "" "" [-l file] [-m address] [-n basename] [-s name] dirs | files";
- echo " "" -B : use btoa encoding (default).";
- echo " "" -E : edit instructions for part #0 (passed to mailkit).";
- echo " "" -F : feed instructions from stdin to part #0 (passed to mailkit).";
- ***************
- *** 103,108 ****
- --- 108,114 ----
- echo " "" -H : use hex-encoding.";
- echo " "" -M : include minikit in the distribution.";
- echo " "" -V : print version and patch-level.";
- + echo " "" -S : set each part size in bytes or kbytes (default $maxsize bytes).";
- echo " "" -X : use Electronic Code Block DES encryption.";
- echo " "" -a : acknowledgment requested upon archive extraction.";
- echo " "" -d : put temporary files in the specified directory.";
- ***************
- *** 110,117 ****
- echo " "" -f : feed instructions from stdin in each part (passed to mailkit).";
- echo " "" -h : to print this help message.";
- echo " "" -k : sets the key used for data encryption.";
- ! echo " "" -m : invoke mailkit to mail the parts.";
- ! echo " "" "" "" "" "" "" There may be as many -m as necessary.";
- echo " "" -l : file holding the recipient list (passed to mailkit).";
- echo " "" -n : set the basename of the generated parts (default is $partname).";
- echo " "" -p : preserve files sent (given to mailkit).";
- --- 116,122 ----
- echo " "" -f : feed instructions from stdin in each part (passed to mailkit).";
- echo " "" -h : to print this help message.";
- echo " "" -k : sets the key used for data encryption.";
- ! echo " "" -m : invoke mailkit to mail the parts (multiple occurrences combine).";
- echo " "" -l : file holding the recipient list (passed to mailkit).";
- echo " "" -n : set the basename of the generated parts (default is $partname).";
- echo " "" -p : preserve files sent (given to mailkit).";
- ***************
- *** 145,150 ****
- --- 150,159 ----
- -E|-e|-F|-f|-p) mailopt="$mailopt $1"
- shift
- ;;
- + -S) maxvalue="$2"
- + shift
- + shift
- + ;;
- -X) desopt="-b"
- mode="zec"
- shift
- ***************
- *** 241,246 ****
- --- 250,267 ----
- '') subject=$1
- esac
-
- + # Compute maximum kit size (can be given in bytes or in kbytes)
- + maxvalue=`echo "$maxvalue" | sed -e 's/^\(.*\)[kK]/\1 \\\\* 1024/'`
- + maxvalue=`eval expr $maxvalue 2>/dev/null`
- + maxsize=${maxvalue:-$maxsize}
- +
- + # The number of lines to be kept in each splited file is computed based on the
- + # average of 80 characters per line, and 2500 bytes are removed from the actual
- + # size for header overhead.
- + split=`expr $maxsize - 2500`
- + split=`expr $split / 80`
- + split=${split:-600}
- +
- # We have two encoding methods for binary datas:
- # - hexencode: brute force (mogenix)
- # - btoa: binary to ascii (ram)
- ***************
- *** 317,325 ****
-
- # Check whether we can use cshar or not
- if (makekit -v) >/dev/null 2>&1; then
- ! makekit="makekit -k100 -n $partname ${split_file}* $others"
- else
- ! makekit="$libdir/makeshar -n $partname ${split_file}* $others"
- fi
-
- echo "Coding with $coding"
- --- 338,346 ----
-
- # Check whether we can use cshar or not
- if (makekit -v) >/dev/null 2>&1; then
- ! makekit="makekit -k100 -s $maxsize -n $partname ${split_file}* $others"
- else
- ! makekit="$libdir/makeshar -s $maxsize -n $partname ${split_file}* $others"
- fi
-
- echo "Coding with $coding"
- ***************
- *** 326,332 ****
- # Beware: 'eval $coding < $tmpfile' is not portable
- status=1
- cat $tmpfile | eval $coding |
- ! split -600 - $split_file &&
- eval $makekit && status=0
- rm ${split_file}* $others $tmpfile
- case "$status" in
- --- 347,353 ----
- # Beware: 'eval $coding < $tmpfile' is not portable
- status=1
- cat $tmpfile | eval $coding |
- ! split -$split - $split_file &&
- eval $makekit && status=0
- rm ${split_file}* $others $tmpfile
- case "$status" in
- ***************
- *** 378,384 ****
-
- # If -m option used, invoke mailkit
- if test $invoke = yes; then
- ! $mailkit -n $partname $mailopt "$subject" $address
- fi
- !NO!SUBS!
- chmod 755 kit
- --- 399,405 ----
-
- # If -m option used, invoke mailkit
- if test $invoke = yes; then
- ! $mailkit -n $partname -c $mailopt "$subject" $address
- fi
- !NO!SUBS!
- chmod 755 kit
-
- Index: man/kit.SH
- Prereq: 2.0.1.8
- *** man/kit.SH.old Sat May 2 14:20:55 1992
- --- man/kit.SH Sat May 2 14:20:57 1992
- ***************
- *** 18,26 ****
- .TH KIT $manext ram
- ''' @(#) Manual page for mailing kit -- (c) ram July 1990
- '''
- ! ''' $Id: kit.SH,v 2.0.1.8 92/04/20 17:42:36 ram Exp $
- '''
- ''' $Log: kit.SH,v $
- ''' Revision 2.0.1.8 92/04/20 17:42:36 ram
- ''' patch15: documents the new -a option
- ''' patch15: older kits will not honor -a or -M (new paragraph in BUGS)
- --- 18,32 ----
- .TH KIT $manext ram
- ''' @(#) Manual page for mailing kit -- (c) ram July 1990
- '''
- ! ''' $Id: kit.SH,v 2.0.1.9 92/05/02 14:19:05 ram Exp $
- '''
- ''' $Log: kit.SH,v $
- + ''' Revision 2.0.1.9 92/05/02 14:19:05 ram
- + ''' patch16: documents new -r option for mailkit and -S for kit
- + ''' patch16: mailkit now supports multiple -l options
- + ''' patch16: two environment variables are used: EDITOR and MAILER
- + ''' patch16: added example using mailkit -r
- + '''
- ''' Revision 2.0.1.8 92/04/20 17:42:36 ram
- ''' patch15: documents the new -a option
- ''' patch15: older kits will not honor -a or -M (new paragraph in BUGS)
- ***************
- *** 62,74 ****
- .SH NAME
- kit, mailkit, unkit \- the ultimate mailing tools
- .SH SYNOPSIS
- ! \fBkit\fR [ \fB\-EFHMBVXefhpx\fR ] [ \fB\-a\fI address\fR] [ \fB\-k\fI key\fR]
- [ \fB\-d\fI dir\fR ] [ \fB\-m\fI address\fR ] [ \fB\-n\fI basename\fR ]
- [ \fB\-l\fI file\fR ] [ \fB\-s\fI name\fR ] \fIdirectories\fR | \fIfiles\fR
- ! .br
- ! \fBmailkit\fR [ \fB\-EFVefhp\fR ] [ \fB\-l\fI file\fR ]
- [ \fB\-n\fI partname\fR ] \fItitle\fR [ \fIaddress(es)\fR ]
- ! .br
- \fBunkit\fR [ \fB\-bhlprV\fR ] [ \fIfiles\fR ]
- .SH DESCRIPTION
- \fIKit\fR is the ultimate mailing tool. It enables you to mail
- --- 68,81 ----
- .SH NAME
- kit, mailkit, unkit \- the ultimate mailing tools
- .SH SYNOPSIS
- ! \fBkit\fR [ \fB\-EFHMBVXefhpx\fR ] [ \fB\-S\fI size\fR ]
- ! [ \fB\-a\fI address\fR ] [ \fB\-k\fI key\fR ]
- [ \fB\-d\fI dir\fR ] [ \fB\-m\fI address\fR ] [ \fB\-n\fI basename\fR ]
- [ \fB\-l\fI file\fR ] [ \fB\-s\fI name\fR ] \fIdirectories\fR | \fIfiles\fR
- ! .sp
- ! \fBmailkit\fR [ \fB\-EFVcefhp\fR ] [ \fB\-l\fI file\fR ]
- [ \fB\-n\fI partname\fR ] \fItitle\fR [ \fIaddress(es)\fR ]
- ! .sp
- \fBunkit\fR [ \fB\-bhlprV\fR ] [ \fIfiles\fR ]
- .SH DESCRIPTION
- \fIKit\fR is the ultimate mailing tool. It enables you to mail
- ***************
- *** 129,134 ****
- --- 136,147 ----
- end has at least the 2.0 PL15 release. You will receive a short message with
- a \fIjunk\fR precedence, telling you who extracted the archive and when.
- .PP
- + The default part size generated by kit is currently 50000 bytes. However, this
- + can be changed throughout the \fB\-S\fR option, which expects a part size as
- + argument. It can be given in bytes (e.g. \fI\-S 40000\fR to set the maximum
- + part size to 40000 bytes) or in kbytes by appending a \fIk\fR at the end
- + (i.e. \fI-S 60k\fR would produce parts with size ranging up to 61440 bytes).
- + .PP
- \fIMailkit\fR takes "Kit*" files and sends them to a list of addresses.
- The \fB\-n\fR option can be used to change that base name, if necessary.
- Each message sent corresponds to one part and has its \`Subject:'
- ***************
- *** 153,159 ****
- as a file whith recipients addresses in it and adds the optional addresses that
- may be given on the command line. Addresses in the recipient file are
- separated with spaces, commas or new lines. Shell-style comments starting with
- ! a pound sign (#) are allowed.
- .PP
- \fIUnkit\fR is used to restore the original files. The argument is
- a list of archive files (or mail files, as \fIunshar\fR(1), which
- --- 166,199 ----
- as a file whith recipients addresses in it and adds the optional addresses that
- may be given on the command line. Addresses in the recipient file are
- separated with spaces, commas or new lines. Shell-style comments starting with
- ! a pound sign (#) are allowed. More than one \fB\-l\fR can be used to get
- ! addresses from multiple files (duplicates will not be removed by \fImailkit\fR
- ! but should be taken care of by the underlying transport mechanism).
- ! .PP
- ! If \fImailkit\fR is invoked by \fIkit\fR via \fB\-m\fR options, it will be
- ! given the \fB\-c\fR flag to clean up parts when they are successfully sent,
- ! unless \fB\-p\fR was also provided. However, when invoking \fImailkit\fR
- ! directly from a shell, the default action is to not remove the parts when they
- ! have been sent (that is to say, \fB\-p\fR is the default action unless you
- ! add the \fB-c\fR option yourself). If for some reason one part could not be
- ! sent and \fImailkit\fR was directed to remove parts when sent, then the
- ! file is not removed immediately. If the input and output are connected to a
- ! terminal, \fImailkit\fR will ask you at the end whether you wish to keep the
- ! unsent parts, on an individual basis. Otherwise, (e.g. standard output
- ! redirected to a file), the unsent parts will be removed without asking.
- ! .PP
- ! Another useful feature when invoking \fImailkit\fR manually is the ability
- ! to send only a subset of all the kit parts by using the \fB\-r\fR option
- ! and supplying a range list of parts to be sent. A \fIrange list\fR
- ! is a set of ranges comma separated. A \fIrange\fR is a part number by itself or
- ! a set of two numbers
- ! separated with a minus sign, indicating the lowest and the largest bound, hence
- ! specifying an interval. If the lowest bound is missing, 1 is assumed. If the
- ! largest bound is missing, the total number of parts is substituted. Thus,
- ! a range of \fI1-\fR means all the parts, while \fI1,4-7,10\fR would send parts
- ! 1, 4 trough 7 and 10. Finally, \fI-5,8-\fR would send parts 1 through 5 and
- ! 8 up to the end. If you introduce spaces in your range list specification,
- ! do not forget to quote the whole list for the shell...
- .PP
- \fIUnkit\fR is used to restore the original files. The argument is
- a list of archive files (or mail files, as \fIunshar\fR(1), which
- ***************
- *** 221,228 ****
- $privlib/rshar
- a simple shell archive maker.
- .PD
- .SH NOTES
- - .PP
- Kit may now be used as a standalone package, i.e. without the help of
- the \fIcshar\fR distribution.
- This was not true before version 2.0 PL10. Two simple shell scripts
- --- 261,278 ----
- $privlib/rshar
- a simple shell archive maker.
- .PD
- + .SH ENVIRONMENT
- + The following environment variables are paid attention to by \fImailkit\fR. If
- + they are not set, a default determined at configuration time will be used:
- + .TP 15
- + EDITOR
- + the name of the editor to call when -E option and friends are used.
- + .TP
- + MAILER
- + the name of the program to invoke to send mail. This program must be
- + ready to take a list of addresses as argument and the whole message
- + (with some headers already computed) from standard input.
- .SH NOTES
- Kit may now be used as a standalone package, i.e. without the help of
- the \fIcshar\fR distribution.
- This was not true before version 2.0 PL10. Two simple shell scripts
- ***************
- *** 241,247 ****
- not smart at all in case of errors. However, this is useful if
- you do not have \fBcshar\fR, but still want to use \fIunkit\fR.
- .SH EXAMPLES
- - .PP
- To mail \fIram@educ.emse.fr\fR a directory called XLOCK and all what it may
- hold, do:
- .sp
- --- 291,296 ----
- ***************
- *** 256,261 ****
- --- 305,318 ----
- .sp
- .in +5
- .B kit \-m ram@educ.emse.fr XLOCK
- + .in -5
- + .sp
- + Assuming the XLOCK package has 5 kit parts, you could send only parts 3 and 5
- + by using:
- + .sp
- + .in +5
- + .br
- + .B mailkit -r 3,5 XLOCK ram@eiffel.com
- .in -5
- .sp
- If you have no write permissions in the current directory, you can
-
- Index: kit/mailkit.SH
- Prereq: 2.0.1.7
- *** kit/mailkit.SH.old Sat May 2 14:20:43 1992
- --- kit/mailkit.SH Sat May 2 14:20:45 1992
- ***************
- *** 18,26 ****
- # @(#) Mailer for kit files
- # @(#) (c) R. Manfredi, 1990 1991
-
- ! # $Id: mailkit.SH,v 2.0.1.7 92/04/20 17:37:36 ram Exp $
- #
- # $Log: mailkit.SH,v $
- # Revision 2.0.1.7 92/04/20 17:37:36 ram
- # patch15: added the bulk Precedence and X-Mailer headers
- # patch15: fixed incorrect help message regarding -l
- --- 18,35 ----
- # @(#) Mailer for kit files
- # @(#) (c) R. Manfredi, 1990 1991
-
- ! # $Id: mailkit.SH,v 2.0.1.8 92/05/02 14:17:01 ram Exp $
- #
- # $Log: mailkit.SH,v $
- + # Revision 2.0.1.8 92/05/02 14:17:01 ram
- + # patch16: there can now be multiple occurences of -l
- + # patch16: -p is now the default option unless -c is used
- + # patch16: kit now invokes mailkit with -c to force clean up
- + # patch16: mailkit asks for unsent part disposal when needed
- + # patch16: now pays attention to EDITOR and MAILER env vars
- + # patch16: new -r option to specify range of parts to be sent
- + # patch16: added -c option to force cleanup of parts
- + #
- # Revision 2.0.1.7 92/04/20 17:37:36 ram
- # patch15: added the bulk Precedence and X-Mailer headers
- # patch15: fixed incorrect help message regarding -l
- ***************
- *** 63,68 ****
- --- 72,78 ----
- # Which patch-level is it ?
- pl='$PATCHLEVEL'
- version='$VERSION'
- + libdir='$privlib'
- !GROK!THIS!
- $spitshell >>mailkit <<'!NO!SUBS!'
-
- ***************
- *** 70,93 ****
- edit=no
- added=no
- feed=no
- ! preserve=no
- recipients=''
-
- ! # Default part's name
- ! partname="Kit"
-
- # Old Bourne shells do not have functions
- usage='
- ! echo "Usage: mailkit [-EFVefhp] [-n base] [-l file] prog_name [address_list]";
- echo " "" -E : edit a message that will be sent as part #0";
- echo " "" -F : feed message from stdin and sent it as part #0";
- echo " "" -V : print version and patch-level";
- echo " "" -e : edit a message that will be added to every part";
- echo " "" -f : feed message from stdin to every part";
- echo " "" -h : to print this help message.";
- ! echo " "" -l : get recipients from a file.";
- echo " "" -n : set the basename of parts to be sent (default is $partname).";
- ! echo " "" -p : preserve files sent.";
- exit 1;
- '
-
- --- 80,107 ----
- edit=no
- added=no
- feed=no
- ! preserve=dflt
- recipients=''
-
- ! partname='Kit' # Default part's name
- ! range='1-' # Default range (all parts)
- ! unsent='' # Parts which could not be sent
-
- # Old Bourne shells do not have functions
- usage='
- ! echo "Usage: mailkit [-EFVcefhp] [-n base] [-l file] [-r range]";
- ! echo " "" "" "" "" "" "" progname [address_list]";
- echo " "" -E : edit a message that will be sent as part #0";
- echo " "" -F : feed message from stdin and sent it as part #0";
- echo " "" -V : print version and patch-level";
- + echo " "" -c : clean up after each part sent.";
- echo " "" -e : edit a message that will be added to every part";
- echo " "" -f : feed message from stdin to every part";
- echo " "" -h : to print this help message.";
- ! echo " "" -l : get recipients from a file (multiple occurences allowed).";
- echo " "" -n : set the basename of parts to be sent (default is $partname).";
- ! echo " "" -p : preserve files sent (default, unless -c specified).";
- ! echo " "" -r : define parts to be sent (default is 1-).";
- exit 1;
- '
-
- ***************
- *** 102,107 ****
- --- 116,126 ----
- added=no
- shift
- ;;
- + -c) case "$preserve" in
- + dflt) preserve=no;;
- + esac
- + shift
- + ;;
- -e) edit=yes
- added=yes
- shift
- ***************
- *** 111,117 ****
- -p) preserve=yes
- shift
- ;;
- ! -l) recipients="$2"
- shift
- shift
- ;;
- --- 130,136 ----
- -p) preserve=yes
- shift
- ;;
- ! -l) recipients="$recipients $2"
- shift
- shift
- ;;
- ***************
- *** 119,124 ****
- --- 138,147 ----
- shift
- shift
- ;;
- + -r) range="${2:-$range}"
- + shift
- + shift
- + ;;
- -f) feed=yes
- added=yes
- shift
- ***************
- *** 144,150 ****
- fi
-
- # Save arguments before using set
- - this_prog=$0
- prog_name=$1
- shift
- address=$@
- --- 167,172 ----
- ***************
- *** 156,162 ****
- # The format of the file is simple: a list of addresses, one per
- # line. Shell-style comments are allowed and multiple addresses on a
- # single line may be separated with spaces or commas.
- ! set X `<$recipients sed -n -e '/^[^#]/ {' \
- -e 's/#.*//' \
- -e 's/,/ /g' \
- -e 's/\n/ /' \
- --- 178,184 ----
- # The format of the file is simple: a list of addresses, one per
- # line. Shell-style comments are allowed and multiple addresses on a
- # single line may be separated with spaces or commas.
- ! set X `cat $recipients | sed -n -e '/^[^#]/ {' \
- -e 's/#.*//' \
- -e 's/,/ /g' \
- -e 's/\n/ /' \
- ***************
- *** 165,177 ****
- shift
- address=$@
- else
- ! echo >&2 "$this_prog: can't open $recipients"
- exit 1
- fi
- fi
-
- if test "x$address" = x; then
- ! echo >&2 "$this_prog: missing recipient list"
- eval $usage
- fi
-
- --- 187,199 ----
- shift
- address=$@
- else
- ! echo >&2 "mailkit: can't open $recipients"
- exit 1
- fi
- fi
-
- if test "x$address" = x; then
- ! echo >&2 "mailkit: missing recipient list"
- eval $usage
- fi
-
- ***************
- *** 212,219 ****
- cat >>$message <<'EOM'
- ------------------------------------------------------------------------
- EOM
- # Call the editor
- ! $editor $message
-
- # Now remove the 4 lines at the top
- # Do not use tail +5, as this may not exist on every system
- --- 234,248 ----
- cat >>$message <<'EOM'
- ------------------------------------------------------------------------
- EOM
- + # If there is a part #0, append it before calling the editor
- + if test -f ${partname}00; then
- + echo "mailkit: using previously unsent instructions..." >&2
- + sleep 2
- + cat ${partname}00 >>$message
- + fi
- +
- # Call the editor
- ! ${EDITOR:-$editor} $message
-
- # Now remove the 4 lines at the top
- # Do not use tail +5, as this may not exist on every system
- ***************
- *** 226,231 ****
- --- 255,261 ----
- then
- rm -f $message
- edit=no
- + echo "mailkit: discarding empty message." >&2
- fi
- elif test $feed = yes; then
- edit=yes # No differences from now on
- ***************
- *** 233,259 ****
- fi
-
- # Print recipient list
- ! echo "Mailing \"$prog_name\" to the following recipient list:"
- echo $address | tr ' ' '\012' | sed -e 's/^/ /'
-
- ! for i in $partname??
- do
- ! # Extracts the part number (will it work on all systems ?)
- ! # Note that this does not rely on the leader part of the name.
- ! part=`expr $i : '[^0-9]*\(.*\)'`
- !
- ! # Remove leading zero(s).
- ! # Is there a simpler way to do this ?
- ! part_num=`expr ${part:-1} + 0`
-
- ! # Protect against unexisting/unreadable files matching "$partname*"
- ! if test -f $i -a -r $i
- then
- ! echo "Mailing $i..."
- # System V /bin/mail does not recognize header correctly, unless the
- # first line is a subject. Oh well...
- cat > $topmsg <<EOH
- ! Subject: $prog_name - kit #$part_num / $nfiles
- To: $address
- Precedence: bulk
- X-Mailer: mailkit [version $version PL$pl]
- --- 263,294 ----
- fi
-
- # Print recipient list
- ! echo "Mailing \"$prog_name\" ($range) to:"
- echo $address | tr ' ' '\012' | sed -e 's/^/ /'
-
- ! # Expand given range
- ! range=`$libdir/range $nfiles $range`
- !
- ! for i in $range
- do
- ! # Add leading zero if number < 10
- ! if test $i -lt 10; then
- ! pn="0$i"
- ! else
- ! pn=$i
- ! fi
-
- ! # Compute file name
- ! part=$partname$pn
- !
- ! # Protect against unexisting/unreadable files
- ! if test -f $part -a -r $part
- then
- ! echo "Mailing $part..."
- # System V /bin/mail does not recognize header correctly, unless the
- # first line is a subject. Oh well...
- cat > $topmsg <<EOH
- ! Subject: $prog_name - kit #$i / $nfiles
- To: $address
- Precedence: bulk
- X-Mailer: mailkit [version $version PL$pl]
- ***************
- *** 276,286 ****
- EOM
- fi
- fi
- ! cat $i >> $topmsg
- ! $mailer $address < $topmsg
- rm -f $topmsg
- else
- ! echo "$this_prog: could not open $i" >&2
- fi
- done
-
- --- 311,329 ----
- EOM
- fi
- fi
- ! cat $part >> $topmsg
- ! # Remove part sucessfully sent unless '-p' was used
- ! if ${MAILER:-$mailer} $address < $topmsg; then
- ! test "$preserve" = no && rm -f $part
- ! else
- ! echo "mailkit: could not send $part." >&2
- ! if test "$preserve" = no; then
- ! unsent="$unsent $part"
- ! fi
- ! fi
- rm -f $topmsg
- else
- ! echo "mailkit: could not open $part" >&2
- fi
- done
-
- ***************
- *** 298,310 ****
- EOM
- cat >>$topmsg <$message
- echo "Mailing instructions..."
- ! $mailer $address < $topmsg
- ! rm -f $topmsg
- fi
-
- - # Clean up
- - rm -f $message
- - test $preserve = no && rm -f $partname??
- !NO!SUBS!
- chmod 755 mailkit
- $eunicefix mailkit
- --- 341,379 ----
- EOM
- cat >>$topmsg <$message
- echo "Mailing instructions..."
- ! if ${MAILER:-$mailer} $address < $topmsg; then
- ! rm -f $topmsg $message ${partname}00
- ! else
- ! echo "mailkit: could not send instructions." >&2
- ! cp $message ${partname}00
- ! if test "$preserve" = no; then
- ! unsent="$unsent ${partname}00"
- ! else
- ! echo "mailkit: instruction message saved as ${partname}00." >&2
- ! fi
- ! rm -f $topmsg $message
- ! fi
- ! fi
- !
- ! # When there are some parts which could not be sent and the command is run from
- ! # a terminal, ask the user what should be done with those unsent files.
- ! # Otherwise simply remove them.
- ! if test "$unsent"; then
- ! if test -t 0 -a -t 1; then
- ! echo "mailkit: would you like to remove the following unsent parts?"
- ! echo "mailkit: (keeping them would allow you to try again later.)"
- ! rm -i $unsent
- ! else
- ! echo "mailkit: removing unsent parts." >&2
- ! rm -f $unsent
- ! fi
- ! else
- ! if test -f ${partname}00; then
- ! echo "mailkit: removing instructions held in ${partname}00." >&2
- ! rm -f ${partname}00
- ! fi
- fi
-
- !NO!SUBS!
- chmod 755 mailkit
- $eunicefix mailkit
-
- Index: kit/range.SH
- *** kit/range.SH.old Sat May 2 14:20:49 1992
- --- kit/range.SH Sat May 2 14:20:49 1992
- ***************
- *** 0 ****
- --- 1,82 ----
- + 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 kit/range (with variable substitutions)"
- + $spitshell >range <<!GROK!THIS!
- + $startsh
- + !GROK!THIS!
- +
- + $spitshell >>range <<'!NO!SUBS!'
- + # Peform range expansion (first parameter is maximum value for open ranges)
- + # Numbers may be space or comma separated. Ranges are a-b. If a is missing,
- + # 1 is assumed. If b is missing, the maximum value is used.
- +
- + # $Id: range.SH,v 2.0.1.1 92/05/02 14:17:22 ram Exp $
- + #
- + # $Log: range.SH,v $
- + # Revision 2.0.1.1 92/05/02 14:17:22 ram
- + # patch16: created
- + #
- +
- + # The first parameter gives the maximum number allowed
- + maxspec=$1
- + shift
- +
- + # Make sure every range is space separated
- + set X `echo "$*" | sed -e 's/,/ /g'`
- + shift
- +
- + range=''
- + for i in $*; do
- + # Deal with incomplete ranges (e.g. -5 or 10-)
- + case "X${i}X" in
- + X-*) i="1$i";;
- + *-X) i="$i$maxspec";;
- + esac
- + # Add the range (expanded when necessary) into $range
- + case "$i" in
- + *-*)
- + end=`expr $i : '[0-9]*-\(.*\)'`
- + start=`expr $i : '\(.*\)-[0-9]*'`
- + vector=`awk "
- + BEGIN {for (i = $start; i <= $end; i++) printf(\"%d \", i);}"
- + < /dev/null`
- + range="$range $vector"
- + ;;
- + *)
- + range="$range $i"
- + ;;
- + esac
- + done
- +
- + # Now remove duplicates, sort numbers and discard values above the maximum
- + echo "$range" | tr ' ' '\012' | awk '
- + BEGIN {
- + max = '$maxspec';
- + }
- + /^[0-9]+/ {
- + val = $1;
- + if (val <= max)
- + num[val] = val;
- + }
- + END {
- + for (i = 1; i <= max; i++)
- + if (num[i])
- + printf("%d ", i);
- + printf("\n");
- + }
- + '
- + !NO!SUBS!
- + chmod 755 range
- + $eunicefix range
-
- Index: shar/makeshar.SH
- Prereq: 2.0.1.3
- *** shar/makeshar.SH.old Sat May 2 14:21:03 1992
- --- shar/makeshar.SH Sat May 2 14:21:03 1992
- ***************
- *** 17,25 ****
- $startsh
- # (c) Raphael Manfredi, December 25th 1991
-
- ! # $Id: makeshar.SH,v 2.0.1.3 92/03/24 13:37:34 ram Exp $
- #
- # $Log: makeshar.SH,v $
- # Revision 2.0.1.3 92/03/24 13:37:34 ram
- # patch14: fixed a typo
- #
- --- 17,28 ----
- $startsh
- # (c) Raphael Manfredi, December 25th 1991
-
- ! # $Id: makeshar.SH,v 2.0.1.4 92/05/02 14:19:45 ram Exp $
- #
- # $Log: makeshar.SH,v $
- + # Revision 2.0.1.4 92/05/02 14:19:45 ram
- + # patch16: maximum part size can now be specified via -s
- + #
- # Revision 2.0.1.3 92/03/24 13:37:34 ram
- # patch14: fixed a typo
- #
- ***************
- *** 44,49 ****
- --- 47,54 ----
-
- # Default settings
- partname=Part
- + maxsize=50000
- + value=$maxsize
-
- # Option parsing
- while test $# -gt 0
- ***************
- *** 53,58 ****
- --- 58,67 ----
- partname="$1"
- shift
- ;;
- + -s) shift
- + maxsize="$1"
- + shift
- + ;;
- -*) echo "unknown option $1"
- exit 1
- ;;
- ***************
- *** 78,87 ****
- # 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";
- --- 87,96 ----
- # put in the archives, each line counting for one part. The first line is
- # the number of archives to be used.
- BEGIN {
- ! maxsize = '$maxsize'; # 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";
-
- Index: kit/Makefile.SH
- Prereq: 2.0.1.4
- *** kit/Makefile.SH.old Sat May 2 14:20:27 1992
- --- kit/Makefile.SH Sat May 2 14:20:28 1992
- ***************
- *** 18,26 ****
- # Makefile for kit (sub-directory kit)
- #
-
- ! # $Id: Makefile.SH,v 2.0.1.4 92/04/20 17:32:57 ram Exp $
- #
- # $Log: Makefile.SH,v $
- # Revision 2.0.1.4 92/04/20 17:32:57 ram
- # patch15: now creates directories before installing
- # patch15: minikit is now created via a .SH file
- --- 18,29 ----
- # Makefile for kit (sub-directory kit)
- #
-
- ! # $Id: Makefile.SH,v 2.0.1.5 92/05/02 14:13:13 ram Exp $
- #
- # $Log: Makefile.SH,v $
- + # Revision 2.0.1.5 92/05/02 14:13:13 ram
- + # patch16: added rules for new range script
- + #
- # Revision 2.0.1.4 92/04/20 17:32:57 ram
- # patch15: now creates directories before installing
- # patch15: minikit is now created via a .SH file
- ***************
- *** 47,53 ****
- !GROK!THIS!
- $spitshell >>Makefile <<'!NO!SUBS!'
- bin = kit mailkit unkit
- ! scripts = $(bin) minikit
- scriptsh = kit.SH mailkit.SH unkit.SH minikit.SH
- added = Makefile config.sh
-
- --- 50,57 ----
- !GROK!THIS!
- $spitshell >>Makefile <<'!NO!SUBS!'
- bin = kit mailkit unkit
- ! lib = minikit range
- ! scripts = $(bin) $(lib)
- scriptsh = kit.SH mailkit.SH unkit.SH minikit.SH
- added = Makefile config.sh
-
- ***************
- *** 71,77 ****
- ../install -m 755 $$file $(binsh); \
- done
- ../install -d $(libdir)
- ! ../install -m 644 minikit $(libdir)
-
- clean:
- $(RM) -f $(scripts)
- --- 75,83 ----
- ../install -m 755 $$file $(binsh); \
- done
- ../install -d $(libdir)
- ! -for file in $(lib); do \
- ! ../install -m 755 $$file $(libdir); \
- ! done
-
- clean:
- $(RM) -f $(scripts)
-
- Index: install.SH
- Prereq: 2.0.1.2
- *** install.SH.old Sat May 2 14:20:22 1992
- --- install.SH Sat May 2 14:20:22 1992
- ***************
- *** 18,26 ****
- # @(#) Installing script accepting bsd-style arguments
- # Derived from a script found in the X11R4 distribution.
-
- ! # $Id: install.SH,v 2.0.1.2 91/07/30 17:20:35 ram Exp $
- #
- # $Log: install.SH,v $
- # Revision 2.0.1.2 91/07/30 17:20:35 ram
- # patch6: new install.SH script
- #
- --- 18,29 ----
- # @(#) Installing script accepting bsd-style arguments
- # Derived from a script found in the X11R4 distribution.
-
- ! # $Id: install.SH,v 2.0.1.3 92/05/02 14:12:31 ram Exp $
- #
- # $Log: install.SH,v $
- + # Revision 2.0.1.3 92/05/02 14:12:31 ram
- + # patch16: minor typo fix in mkdir_p
- + #
- # Revision 2.0.1.2 91/07/30 17:20:35 ram
- # patch6: new install.SH script
- #
- ***************
- *** 53,59 ****
- # simulates mkdir -p
- mkdir_p='
- name=$1;
- ! create='';
- while $test $name; do
- if $test ! -d "$name"; then
- create="$name $create";
- --- 56,62 ----
- # simulates mkdir -p
- mkdir_p='
- name=$1;
- ! create="";
- while $test $name; do
- if $test ! -d "$name"; then
- create="$name $create";
- ***************
- *** 60,66 ****
- name=`echo $name | $sed -e "s|^[^/]*$||"`;
- name=`echo $name | $sed -e "s|\(.*\)/.*|\1|"`;
- else
- ! name='';
- fi;
- done;
- for file in $create; do
- --- 63,69 ----
- name=`echo $name | $sed -e "s|^[^/]*$||"`;
- name=`echo $name | $sed -e "s|\(.*\)/.*|\1|"`;
- else
- ! name="";
- fi;
- done;
- for file in $create; do
-
- Index: badtar/badtar.SH
- Prereq: 2.0.1.1
- *** badtar/badtar.SH.old Sat May 2 14:20:16 1992
- --- badtar/badtar.SH Sat May 2 14:20:17 1992
- ***************
- *** 12,26 ****
- case "$0" in
- */*) cd `expr X$0 : 'X\(.*\)/'` ;;
- esac
- ! echo "Extracting man/badtar.$manext (with variable substitutions)"
- $rm -f badtar.$manext
- $spitshell >badtar.$manext <<!GROK!THIS!
- .TH BABTAR $manext ram
- ''' @(#) Manual page for badtar -- (c) ram January 1992
- '''
- ! ''' $Id: badtar.SH,v 2.0.1.1 92/01/11 19:12:35 ram Exp $
- '''
- ''' $Log: badtar.SH,v $
- ''' Revision 2.0.1.1 92/01/11 19:12:35 ram
- ''' patch11: created
- '''
- --- 12,29 ----
- case "$0" in
- */*) cd `expr X$0 : 'X\(.*\)/'` ;;
- esac
- ! echo "Extracting badtar/badtar.$manext (with variable substitutions)"
- $rm -f badtar.$manext
- $spitshell >badtar.$manext <<!GROK!THIS!
- .TH BABTAR $manext ram
- ''' @(#) Manual page for badtar -- (c) ram January 1992
- '''
- ! ''' $Id: badtar.SH,v 2.0.1.2 92/05/02 14:10:56 ram Exp $
- '''
- ''' $Log: badtar.SH,v $
- + ''' Revision 2.0.1.2 92/05/02 14:10:56 ram
- + ''' patch16: fixed incorrect extraction message
- + '''
- ''' Revision 2.0.1.1 92/01/11 19:12:35 ram
- ''' patch11: created
- '''
-
- Index: MANIFEST
- *** MANIFEST.old Sat May 2 14:21:08 1992
- --- MANIFEST Sat May 2 14:21:09 1992
- ***************
- *** 28,33 ****
- --- 28,34 ----
- kit/kit.SH The main script-shell
- kit/mailkit.SH Mails parts generated by "kit"
- kit/minikit.SH The minikit script for kit extraction
- + kit/range.SH Run range expansion within specified bound
- kit/unkit.SH Reversal of "kit"
- man/Makefile.SH Makefile for manual pages
- man/atob.SH Manual page for "atob"
-
- *** End of Patch 16 ***
-