Update Module-Metadata to CPAN version 1.000006
authorChris 'BinGOs' Williams <chris@bingosnet.co.uk>
Wed, 7 Sep 2011 09:00:41 +0000 (10:00 +0100)
committerChris 'BinGOs' Williams <chris@bingosnet.co.uk>
Wed, 7 Sep 2011 09:00:41 +0000 (10:00 +0100)
  [DELTA]

  1.0.6 2011-08-29 04:00:00
    - Support PACKAGE BLOCK syntax (VPIT)

  [Additional info]

  Reapplied the changes made by Craig Berry for VMS in commit
  63f27fd71dd22aa00021eb1e4fde4faa55ec9524

  Raised [https://rt.cpan.org/Public/Bug/Display.html?id=70781] to
  upstream these changes.

Porting/Maintainers.pl
cpan/Module-Metadata/lib/Module/Metadata.pm
cpan/Module-Metadata/t/metadata.t
pod/perldelta.pod

index 23737f4..0170b91 100755 (executable)
@@ -1288,7 +1288,7 @@ use File::Glob qw(:case);
     'Module::Metadata' =>
        {
        'MAINTAINER'    => 'dagolden',
-       'DISTRIBUTION'  => 'DAGOLDEN/Module-Metadata-1.000005.tar.gz',
+       'DISTRIBUTION'  => 'DAGOLDEN/Module-Metadata-1.000006.tar.gz',
        'FILES'         => q[cpan/Module-Metadata],
        'EXCLUDED'      => [ qr{^maint}, qr{^xt} ],
        'UPSTREAM'      => 'cpan',
index 41d8214..2016967 100644 (file)
@@ -11,7 +11,7 @@ package Module::Metadata;
 
 use strict;
 use vars qw($VERSION);
-$VERSION = '1.000005_01';
+$VERSION = '1.000006';
 $VERSION = eval $VERSION;
 
 use File::Spec;
@@ -36,7 +36,7 @@ my $PKG_REGEXP  = qr{   # match a package declaration
   \s*                   # optional whitespace
   ($V_NUM_REGEXP)?        # optional version number
   \s*                   # optional whitesapce
-  ;                     # semicolon line terminator
+  [;\{]                 # semicolon line terminator or block start (since 5.16)
 }x;
 
 my $VARNAME_REGEXP = qr{ # match fully-qualified VERSION name
index 60cb316..c0e0f12 100644 (file)
@@ -7,9 +7,18 @@ use lib 't/lib';
 use IO::File;
 use MBTest;
 
+my $undef;
+
 # parse various module $VERSION lines
 # these will be reversed later to create %modules
 my @modules = (
+  $undef => <<'---', # no $VERSION line
+package Simple;
+---
+  $undef => <<'---', # undefined $VERSION
+package Simple;
+our $VERSION;
+---
   '1.23' => <<'---', # declared & defined on same line with 'our'
 package Simple;
 our $VERSION = '1.23';
@@ -171,6 +180,26 @@ our $VERSION = '1.23_00_00';
   our $VERSION;
   $VERSION = 'onetwothree';
 ---
+  $undef => <<'---', # package NAME BLOCK, undef $VERSION
+package Simple {
+  our $VERSION;
+}
+---
+  '1.23' => <<'---', # package NAME BLOCK, with $VERSION
+package Simple {
+  our $VERSION = '1.23';
+}
+---
+  '1.23' => <<'---', # package NAME VERSION BLOCK
+package Simple 1.23 {
+  1;
+}
+---
+  'v1.2.3_4' => <<'---', # package NAME VERSION BLOCK
+package Simple v1.2.3_4 {
+  1;
+}
+---
 );
 my %modules = reverse @modules;
 
@@ -242,11 +271,18 @@ foreach my $module ( sort keys %modules ) {
 
     # Test::Builder will prematurely numify objects, so use this form
     my $errs;
-    ok( $pm_info->version eq $expected,
-        "correct module version (expected '$expected')" )
-        or $errs++;
+    my $got = $pm_info->version;
+    if ( defined $expected ) {
+        ok( $got eq $expected,
+            "correct module version (expected '$expected')" )
+            or $errs++;
+    } else {
+        ok( !defined($got),
+            "correct module version (expected undef)" )
+            or $errs++;
+    }
     is( $warnings, '', 'no warnings from parsing' ) or $errs++;
-    diag "Got: '@{[$pm_info->version]}'\nModule contents:\n$module" if $errs;
+    diag "Got: '$got'\nModule contents:\n$module" if $errs;
   }
 }
 
index a1df93a..1b16783 100644 (file)
@@ -177,6 +177,10 @@ support negative zero, so the resulting object was actually malformed
 
 =item *
 
+L<Module::Metadata> has been upgraded from version 1.000005_01 to version 1.000006.
+
+=item *
+
 L<Pod::Simple> has been upgraded from version 3.18 to version 3.19.
 
 =item *