diff options
author | Andreas König <a.koenig@mind.de> | 2003-02-18 12:48:40 +0100 |
---|---|---|
committer | hv <hv@crypt.org> | 2003-02-19 00:19:21 +0000 |
commit | f7047380cf724d6ba2d3de39f9bed88ffab64608 (patch) | |
tree | be54a725ac271504db1fd4172641de5a29bb88fb /patchlevel.h | |
parent | 3c83a670ef5b88bf7bcdc0857c28022b13bf2106 (diff) | |
download | perl-f7047380cf724d6ba2d3de39f9bed88ffab64608.tar.gz |
Make adding notes to patchlevel.h easier
Message-ID: <m3n0kt27av.fsf@k242.linux.bogus>
p4raw-id: //depot/perl@18749
Diffstat (limited to 'patchlevel.h')
-rw-r--r-- | patchlevel.h | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/patchlevel.h b/patchlevel.h index 45f316b7b2..526659a0d8 100644 --- a/patchlevel.h +++ b/patchlevel.h @@ -75,7 +75,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: + +#!perl +die "Usage: perl -x patchlevel.h comment ..." unless @ARGV; +open PLIN, "patchlevel.h" or die "Couldn't open patchlevel.h : $!"; +open PLOUT, ">patchlevel.new" or die "Couldn't write on patchlevel.new : $!"; +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 patchlevel.new : $!"; +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.new", "patchlevel.h" or + die "Couldn't rename patchlevel.new to patchlevel.h : $!"; +__END__ + +Please keep empty lines below so patching of this file doesn't +interfere with the following lines. + */ + + + + + + + #if !defined(PERL_PATCHLEVEL_H_IMPLICIT) && !defined(LOCAL_PATCH_COUNT) static char *local_patches[] = { NULL |