[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index][Thread Index][Top&Search][Original]

[PATCH] consting perlbug breaking in blead & maint



(Also handles new formatting of DEVEL tag in blead, but all should
be safe for maint also.)

--- p/utils/perlbug.PL.orig     2005-09-17 12:07:33.000000000 -0700
+++ p/utils/perlbug.PL  2005-11-13 15:51:08.005574400 -0800
@@ -28,9 +28,15 @@
     or die "Can't open patchlevel.h: $!";
 
 my $patchlevel_date = (stat PATCH_LEVEL)[9];
+my $patchnum = "";
 
 while (<PATCH_LEVEL>) {
-    last if $_ =~ /^\s*static\s+char.*?local_patches\[\]\s*=\s*{\s*$/;
+    $patchnum = $1 if /#define PERL_PATCHNUM\s+(\d+)/;
+    last if $_ =~ /^\s*static\s+(?:const\s+)?char.*?local_patches\[\]\s*=\s*{\s*$/;
+}
+
+if (! defined($_)) {
+    warn "Warning: local_patches section not found in patchlevel.h\n";
 }
 
 my @patches;
@@ -38,6 +44,7 @@
     last if /^\s*}/;
     chomp;
     s/^\s+,?\s*"?//;
+    s/"\s+STRINGIFY\(PERL_PATCHNUM\)/$patchnum"/;
     s/"?\s*,?$//;
     s/(['\\])/\\$1/g;
     push @patches, $_ unless $_ eq 'NULL';


Follow-Ups from:
Steve Peters <steve@fisharerojo.org>

[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index][Thread Index][Top&Search][Original]