home *** CD-ROM | disk | FTP | other *** search
/ Source Code 1994 March / Source_Code_CD-ROM_Walnut_Creek_March_1994.iso / compsrcs / misc / volume41 / mailagnt / patch02 < prev    next >
Encoding:
Text File  |  1993-12-04  |  5.4 KB  |  193 lines

  1. Newsgroups: comp.sources.misc
  2. From: Raphael Manfredi <ram@acri.fr>
  3. Subject: v41i028:  mailagent - Flexible mail filtering and processing package, v3.0, Patch02
  4. Message-ID: <1993Dec4.172905.14701@sparky.sterling.com>
  5. X-Md4-Signature: a40d4801a5f15125e47d3c1aba71f00c
  6. Sender: kent@sparky.sterling.com (Kent Landfield)
  7. Organization: Advanced Computer Research Institute, Lyon, France
  8. Date: Sat, 4 Dec 1993 17:29:05 GMT
  9. Approved: kent@sparky.sterling.com
  10.  
  11. Submitted-by: Raphael Manfredi <ram@acri.fr>
  12. Posting-number: Volume 41, Issue 28
  13. Archive-name: mailagent/patch02
  14. Environment: UNIX, Perl
  15. Patch-To: mailagent: Volume 41, Issue 1-26
  16.  
  17. [The latest patch for mailagent version 3.0 is #2.]
  18.  
  19. System: mailagent version 3.0
  20. Patch #: 2
  21. Priority: HIGH
  22. Subject: Bad RCS headers need to be fixed for subsequent patches
  23. Date: Mon Nov 29 17:45:04 MET 1993
  24. From: Raphael Manfredi <ram@acri.fr>
  25.  
  26. NOTE:
  27.     THIS PATCH FILE CANNOT BE FED DIRECTLY TO THE PATCH PROGRAM.
  28.     PLEASE READ THE INSTRUCTIONS CAREFULLY BEFORE PROCEEDING.
  29.  
  30. Description:
  31.     I have not properly stripped the locker mark in the RCS headers,
  32.     and unfortunately, that will cause subsequent patches to fail on
  33.     those RCS $Id: lines.
  34.  
  35.     The easiest way to fix that was to write a quick perl script to
  36.     post-process each of the source files from your distribution. Issuing
  37.     a regular patch would have been too much of a trouble for everyone.
  38.  
  39.     If you applied patch #1 already, you know what I mean... If you
  40.     did not apply it yet, do so now, and ignore the error message from
  41.     patch (make sure that Configure.rej file lists only the hunk related
  42.     to the $Id: line).
  43.  
  44. Fix:
  45.     Unshar this patch file in your mailagent directory, at the top-level.
  46.     This will create a single file named rcs_fix.
  47.  
  48.     Run it:
  49.         ./rcs_fix
  50.     
  51.     It's a perl script, so you need perl in your path. Since mailagent
  52.     is written in perl, if you don't have perl, then the whole distribution
  53.     is useless to you anyway ;-)
  54.  
  55.     The script will fix all the files listed in MANIFEST, then it will
  56.     fix your Configure script to correct the problem raised by patch #1,
  57.     so that future patches on that file may apply smoothly.
  58.  
  59.     All the original files are renamed into .bak files before being
  60.     updated, so you may revert to the original "easily" if something
  61.     goes wrong. Your patchlevel.h file will be updated by the script
  62.     itself.
  63.  
  64.     After having run rcs_fix:
  65.         Configure -ders
  66.         make depend
  67.         make
  68.  
  69.     If all is ok at this point, you may issue:
  70.         rm rcs_fix
  71.         find . -name "*.bak" | xargs rm -f
  72.  
  73.     If you are missing previous patches they can be obtained from me:
  74.  
  75.         Raphael Manfredi <ram@acri.fr>
  76.  
  77.     If you send a mail message of the following form it will greatly speed
  78.     processing:
  79.  
  80.         Subject: Command
  81.         @SH mailpatch PATH mailagent 3.0 LIST
  82.                ^ note the c
  83.  
  84.     where PATH is a return path FROM ME TO YOU either in Internet notation,
  85.     or in bang notation from some well-known host, and LIST is the number
  86.     of one or more patches you need, separated by spaces, commas, and/or
  87.     hyphens.  Saying 35- says everything from 35 to the end.
  88.  
  89.     To get some more detailed instructions, send me the following mail:
  90.  
  91.         Subject: Command
  92.         @SH mailhelp PATH
  93.  
  94. #! /bin/sh
  95. # This is a shell archive.  Remove anything before this line, then feed it
  96. # into a shell via "sh file" or similar.  To overwrite existing files,
  97. # type "sh file -c".
  98. # The tool that generated this appeared in the comp.sources.unix newsgroup;
  99. # send mail to comp-sources-unix@uunet.uu.net if you want that tool.
  100. # Contents:  rcs_fix
  101. # Wrapped by ram@soft208 on Fri Dec  3 10:36:13 1993
  102. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  103. echo If this archive is complete, you will see the following message:
  104. echo '          "shar: End of archive."'
  105. if test -f 'rcs_fix' -a "${1}" != "-c" ; then 
  106.   echo shar: Will not clobber existing file \"'rcs_fix'\"
  107. else
  108.   echo shar: Extracting \"'rcs_fix'\" \(1270 characters\)
  109.   sed "s/^X//" >'rcs_fix' <<'END_OF_FILE'
  110. X: # feed this into perl
  111. Xeval 'exec perl -i.bak -S $0 "$@"'
  112. X    if $running_under_some_shell;
  113. X
  114. Xopen(MANIFEST, 'MANIFEST') || die "Can't open MANIFEST: $!\n";
  115. Xopen(TTY, '>/dev/tty') || die "Can't open tty: $!\n";
  116. X
  117. X@ARGV = ('patchlevel.h');
  118. Xwhile (<>) {
  119. X    if (/PATCHLEVEL\s+(\d+)/) {
  120. X        if ($1 != 1) {
  121. X            close $ARGV;
  122. X            rename('patchlevel.h.bak', 'patchlevel.h');
  123. X            die "Wrong patch level $1, expected 1\n";
  124. X        }
  125. X        s/PATCHLEVEL(\s+)\d+/PATCHLEVEL 2/;
  126. X    }
  127. X    print;
  128. X}
  129. X
  130. X@ARGV = ();
  131. X
  132. Xwhile (<MANIFEST>) {
  133. X    ($file, $comment) = split;
  134. X    next if -d $file;
  135. X    push(@ARGV, $file);
  136. X}
  137. X
  138. Xclose MANIFEST;
  139. X
  140. X$SIG{'INT'} = 'cleanup';
  141. X
  142. Xwhile (<>) {
  143. X    s/Exp ram \$/Exp $/ if /\$Id:/;
  144. X} continue {
  145. X    print;
  146. X    if ($ARGV ne $oldargv) {
  147. X        print TTY "Fixing $ARGV...\n";
  148. X        $oldargv = $ARGV;
  149. X    }
  150. X}
  151. X
  152. Xprint TTY "Making sure Configure is OK after failed patch #1.\n";
  153. X
  154. X@ARGV = ('Configure');
  155. X$fixed = 0;
  156. X
  157. Xwhile (<>) {
  158. X    if ($fixed || !/\$Id:/) {
  159. X        print;
  160. X        next;
  161. X    }
  162. X    scalar(<>);
  163. X    scalar(<>);
  164. X    print <<'EOM';
  165. X# $Id: Configure,v 3.0.1.1 1993/11/29 16:43:28 ram Exp $
  166. X#
  167. X# Generated on Mon Nov 29 17:39:26 MET 1993 [metaconfig 3.0 PL14]
  168. XEOM
  169. X    $fixed = 1;
  170. X}
  171. X
  172. X
  173. X$SIG{'INT'} = 'DEFAULT';
  174. X
  175. Xsub cleanup {
  176. X    print TTY "Warning: restoring $ARGV\n";
  177. X    rename("$ARGV.bak", $ARGV) || warn "Couldn't restore $ARGV: $!\n";
  178. X    exit 1;
  179. X}
  180. X
  181. END_OF_FILE
  182.   if test 1270 -ne `wc -c <'rcs_fix'`; then
  183.     echo shar: \"'rcs_fix'\" unpacked with wrong size!
  184.   fi
  185.   chmod +x 'rcs_fix'
  186.   # end of 'rcs_fix'
  187. fi
  188. echo shar: End of archive.
  189. exit 0
  190. *** End of Patch 2 ***
  191.  
  192. exit 0 # Just in case...
  193.