develooper Front page | perl.perl5.porters | Postings from January 2001

Re: An alternative to .patch and fix_pl

Thread Previous | Thread Next
January 8, 2001 08:47
Re: An alternative to .patch and fix_pl
Message ID:
>>>>> On Mon, 8 Jan 2001 16:13:56 +0100, "Gerrit P. Haase" <> said:

  > .patch should be called automatic during Configure, and therefore
  > it should be included in the snapshots.

But it isn't. And I doubt that it should. Note that you can apply a
patch easily after the Configure run. The snapshots come with a good
patchlevel.h file, no more is needed. What I propose is that there
should be a way to compile additional snapshot information into
patchlevel.h that is

- scriptable
- easy to use
- easy to remember

Loading patchlevel.h into an editor isn't easy enough, letting
Configure care for it is not flexible enough.

Below is my third try, I forgot indeed the permissions:-(

Thanks for trying!

--- patchlevel.h@8366	Mon Jan  8 13:06:41 2001
+++ patchlevel.h	Mon Jan  8 17:43:45 2001
@@ -66,7 +66,46 @@
 	(Note changes to line numbers as well as removal of context lines.)
 	This will prevent patch from choking if someone has previously
 	applied different patches than you.
+        History has shown that nobody distributes patches that also
+        modify patchlevel.h. Do it yourself. The following perl
+        program can be used to add a comment to patchlevel.h:
+die "Usage: perl -x patchlevel.h comment ..." unless @ARGV;
+open PLIN, "patchlevel.h" or die "Couldn't open patchlevel.h : $!";
+open PLOUT, ">" or die "Couldn't write on : $!";
+my $seen=0;
+while (<PLIN>) {
+    if (/\t,NULL/ and $seen) {
+       while (my $c = shift @ARGV){
+            print PLOUT qq{\t,"$c"\n};
+       }
+    }
+    $seen++ if /local_patches\[\]/;
+    print PLOUT;
+close PLOUT or warn "Couldn't close filehandle writing to : $!";
+close PLIN or warn "Couldn't close filehandle reading from patchlevel.h : $!";
+unlink "patchlevel.bak" or warn "Couldn't unlink patchlevel.bak : $!"
+  if -e "patchlevel.bak";
+rename "patchlevel.h", "patchlevel.bak" or
+  die "Couldn't rename patchlevel.h to patchlevel.bak : $!";
+rename "", "patchlevel.h" or
+  die "Couldn't rename to patchlevel.h : $!";
+Please keep empty lines below so patching of this file doesn't
+interfere with the following lines.
 static	char	*local_patches[] = {

Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About