Commit | Line | Data |
---|---|---|
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 | |
4 | exit unless -e ".patch"; | |
5 | open PATCH, ".patch" or die "Couldn't open .patch: $!"; | |
6 | open PLIN, "patchlevel.h" or die "Couldn't open patchlevel.h : $!"; | |
7 | open PLOUT, ">patchlevel.new" or die "Couldn't write on patchlevel.new : $!"; | |
8 | my $pl = <PATCH>; | |
9 | chomp ($pl); | |
10 | $pl =~ s/\D//g; | |
11 | my $seen=0; | |
12 | while (<PLIN>) { | |
13 | if (/\t,NULL/ and $seen) { | |
14 | print PLOUT "\t,\"devel-$pl\"\n"; | |
15 | } | |
16 | $seen++ if /local_patches\[\]/; | |
17 | print PLOUT; | |
18 | } | |
19 | close PLOUT; close PLIN; | |
20 | rename "patchlevel.new", "patchlevel.h" or die "Couldn't rename: $!"; | |
21 | unlink ".patch"; |