This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
several more tweaks to configure.com
[perl5.git] / fix_pl
CommitLineData
517e7c64
SC
1#!perl
2# Not fixing perl, but fixing the patchlevel if this perl comes
3# from the repository rather than an official release
4exit unless -e ".patch";
5open PATCH, ".patch" or die "Couldn't open .patch: $!";
6open PLIN, "patchlevel.h" or die "Couldn't open patchlevel.h : $!";
7open PLOUT, ">patchlevel.new" or die "Couldn't write on patchlevel.new : $!";
8my $pl = <PATCH>;
9chomp ($pl);
10$pl =~ s/\D//g;
11my $seen=0;
12while (<PLIN>) {
13 if (/\t,NULL/ and $seen) {
14 print PLOUT "\t,\"devel-$pl\"\n";
15 }
16 $seen++ if /local_patches\[\]/;
17 print PLOUT;
18}
19close PLOUT; close PLIN;
20rename "patchlevel.new", "patchlevel.h" or die "Couldn't rename: $!";
21unlink ".patch";