This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
consting perlbug breaking in blead & maint
authorYitzchak Scott-Thoennes <sthoenna@efn.org>
Sun, 13 Nov 2005 16:00:49 +0000 (08:00 -0800)
committerSteve Peters <steve@fisharerojo.org>
Mon, 14 Nov 2005 01:13:16 +0000 (01:13 +0000)
Message-ID: <20051114000049.GA7676@efn.org>

p4raw-id: //depot/perl@26118

utils/perlbug.PL

index c778c9c..8e64828 100644 (file)
@@ -28,9 +28,15 @@ open PATCH_LEVEL, "<" . catfile(updir, "patchlevel.h")
     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 @@ while (<PATCH_LEVEL>) {
     last if /^\s*}/;
     chomp;
     s/^\s+,?\s*"?//;
+    s/"\s+STRINGIFY\(PERL_PATCHNUM\)/$patchnum"/;
     s/"?\s*,?$//;
     s/(['\\])/\\$1/g;
     push @patches, $_ unless $_ eq 'NULL';