This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Upgrade CPAN-Meta from 2.150005 -> 2.150010 (Parse-CPAN-Meta now combined into this...
authorKaren Etheridge <ether@cpan.org>
Thu, 18 Aug 2016 17:14:00 +0000 (10:14 -0700)
committerJames E Keenan <jkeenan@cpan.org>
Fri, 19 Aug 2016 23:44:35 +0000 (19:44 -0400)
    2.150010  2016-08-18 12:10:08-04:00 America/New_York

      [FIXED]

      - the YAML and JSON backend variables are ignored when building/testing the
        perl core itself, where non-core backends are not yet installed.

      [CHANGED]

      - Added "use warnings" to Parse::CPAN::Meta

    2.150009  2016-07-02 21:07:49-04:00 America/New_York (TRIAL RELEASE)

      [FIXED]

      - Fixed used of Encode in Parse::CPAN::Meta::load_json_string
        (Cherry picked from Parse::CPAN::Meta 1.4422)

    2.150008  2016-06-28 17:01:03-04:00 America/New_York (TRIAL RELEASE)

      [ADDED]

      - Merged Parse::CPAN::Meta 1.4420 into this distribution

    2.150007  2016-06-28 03:48:16-04:00 America/New_York (TRIAL RELEASE)

      [FIXED]

      - The cloning routine would raise an error on expected types when it
        previously would stringify.  The old behavior is restored.

    2.150006  2016-06-23 20:05:46-04:00 America/New_York (TRIAL RELEASE)

      [FIXED]

      - CPAN::Meta::Prereqs now fully accepts phases and types starting with 'x_'.
        New 'phases' and 'types_in' interfaces have been added.

      - No longer relies on JSON backend for data structure cloning. This is
        much faster than using JSON::PP.

      [TESTS]

      - The 'extra_mappings' feature for meta merging is now tested and
        documented.

      - During tests, delete new environment variables added by
        Parse::CPAN::Meta 1.4418

      [SPEC]

      - Clarifies acceptable values for booleans

      - Cleaned up text and links of historical specs.

48 files changed:
MANIFEST
Porting/Maintainers.pl
cpan/CPAN-Meta/corpus/BadMETA.yml [new file with mode: 0644]
cpan/CPAN-Meta/corpus/CL018_yaml.meta [moved from cpan/Parse-CPAN-Meta/corpus/CL018_yaml.meta with 100% similarity]
cpan/CPAN-Meta/corpus/META-VR.json [moved from cpan/Parse-CPAN-Meta/corpus/META-VR.json with 100% similarity]
cpan/CPAN-Meta/corpus/META-VR.yml [moved from cpan/Parse-CPAN-Meta/corpus/META-VR.yml with 100% similarity]
cpan/CPAN-Meta/corpus/bareyaml.meta [moved from cpan/Parse-CPAN-Meta/corpus/bareyaml.meta with 100% similarity]
cpan/CPAN-Meta/corpus/json.meta [moved from cpan/Parse-CPAN-Meta/corpus/json.meta with 100% similarity]
cpan/CPAN-Meta/corpus/yaml.meta [moved from cpan/Parse-CPAN-Meta/corpus/yaml.meta with 100% similarity]
cpan/CPAN-Meta/lib/CPAN/Meta/Converter.pm
cpan/CPAN-Meta/lib/CPAN/Meta/Feature.pm
cpan/CPAN-Meta/lib/CPAN/Meta/History.pm
cpan/CPAN-Meta/lib/CPAN/Meta/History/Meta_1_0.pod
cpan/CPAN-Meta/lib/CPAN/Meta/History/Meta_1_1.pod
cpan/CPAN-Meta/lib/CPAN/Meta/History/Meta_1_2.pod
cpan/CPAN-Meta/lib/CPAN/Meta/History/Meta_1_3.pod
cpan/CPAN-Meta/lib/CPAN/Meta/History/Meta_1_4.pod
cpan/CPAN-Meta/lib/CPAN/Meta/Merge.pm
cpan/CPAN-Meta/lib/CPAN/Meta/Prereqs.pm
cpan/CPAN-Meta/lib/CPAN/Meta/Spec.pm
cpan/CPAN-Meta/lib/CPAN/Meta/Validator.pm
cpan/CPAN-Meta/lib/Parse/CPAN/Meta.pm [moved from cpan/Parse-CPAN-Meta/lib/Parse/CPAN/Meta.pm with 88% similarity]
cpan/CPAN-Meta/t/README-data.txt [new file with mode: 0644]
cpan/CPAN-Meta/t/converter-bad.t
cpan/CPAN-Meta/t/converter-fail.t
cpan/CPAN-Meta/t/converter-fragments.t
cpan/CPAN-Meta/t/converter.t
cpan/CPAN-Meta/t/data-test/x_deprecated-META.json [new file with mode: 0644]
cpan/CPAN-Meta/t/data-valid/META-1_4.yml [new file with mode: 0644]
cpan/CPAN-Meta/t/data-valid/META-2.json [new file with mode: 0644]
cpan/CPAN-Meta/t/data-valid/x_deprecated-META.yml [new file with mode: 0644]
cpan/CPAN-Meta/t/lib/Parse/CPAN/Meta/Test.pm [moved from cpan/Parse-CPAN-Meta/t/lib/Parse/CPAN/Meta/Test.pm with 100% similarity]
cpan/CPAN-Meta/t/load-bad.t
cpan/CPAN-Meta/t/merge.t
cpan/CPAN-Meta/t/meta-obj.t
cpan/CPAN-Meta/t/no-index.t
cpan/CPAN-Meta/t/optional_feature-merge.t
cpan/CPAN-Meta/t/parse-cpan-meta/02_api.t [moved from cpan/Parse-CPAN-Meta/t/02_api.t with 84% similarity]
cpan/CPAN-Meta/t/parse-cpan-meta/03_functions.t [moved from cpan/Parse-CPAN-Meta/t/03_functions.t with 100% similarity]
cpan/CPAN-Meta/t/parse-cpan-meta/04_export.t [moved from cpan/Parse-CPAN-Meta/t/04_export.t with 100% similarity]
cpan/CPAN-Meta/t/parse-cpan-meta/05_errors.t [moved from cpan/Parse-CPAN-Meta/t/05_errors.t with 100% similarity]
cpan/CPAN-Meta/t/prereqs-finalize.t
cpan/CPAN-Meta/t/prereqs-merge.t
cpan/CPAN-Meta/t/prereqs.t
cpan/CPAN-Meta/t/repository.t
cpan/CPAN-Meta/t/save-load.t
cpan/CPAN-Meta/t/validator.t
t/TEST

index 34b34e6..7834a2c 100644 (file)
--- a/MANIFEST
+++ b/MANIFEST
@@ -292,6 +292,13 @@ cpan/CPAN/t/02nox.t                See if CPAN::Nox works
 cpan/CPAN/t/03pkgs.t           See if CPAN::Version works
 cpan/CPAN/t/10version.t                See if CPAN the module works
 cpan/CPAN/t/11mirroredby.t             See if CPAN::Mirrored::By works
+cpan/CPAN-Meta/corpus/BadMETA.yml
+cpan/CPAN-Meta/corpus/bareyaml.meta
+cpan/CPAN-Meta/corpus/CL018_yaml.meta
+cpan/CPAN-Meta/corpus/json.meta
+cpan/CPAN-Meta/corpus/META-VR.json
+cpan/CPAN-Meta/corpus/META-VR.yml
+cpan/CPAN-Meta/corpus/yaml.meta
 cpan/CPAN-Meta/lib/CPAN/Meta.pm
 cpan/CPAN-Meta/lib/CPAN/Meta/Converter.pm
 cpan/CPAN-Meta/lib/CPAN/Meta/Feature.pm
@@ -305,6 +312,7 @@ cpan/CPAN-Meta/lib/CPAN/Meta/Merge.pm
 cpan/CPAN-Meta/lib/CPAN/Meta/Prereqs.pm
 cpan/CPAN-Meta/lib/CPAN/Meta/Spec.pm
 cpan/CPAN-Meta/lib/CPAN/Meta/Validator.pm
+cpan/CPAN-Meta/lib/Parse/CPAN/Meta.pm
 cpan/CPAN-Meta/t/converter.t
 cpan/CPAN-Meta/t/converter-bad.t
 cpan/CPAN-Meta/t/converter-fail.t
@@ -351,21 +359,31 @@ cpan/CPAN-Meta/t/data-test/unicode.yml
 cpan/CPAN-Meta/t/data-test/version-not-normal.json
 cpan/CPAN-Meta/t/data-test/version-ranges-1_4.yml
 cpan/CPAN-Meta/t/data-test/version-ranges-2.json
+cpan/CPAN-Meta/t/data-test/x_deprecated-META.json
 cpan/CPAN-Meta/t/data-valid/1122575719-META.yml
 cpan/CPAN-Meta/t/data-valid/1206545041-META.yml
 cpan/CPAN-Meta/t/data-valid/1985684504-META.yml
 cpan/CPAN-Meta/t/data-valid/476602558-META.yml
 cpan/CPAN-Meta/t/data-valid/META-1_0.yml
 cpan/CPAN-Meta/t/data-valid/META-1_1.yml
+cpan/CPAN-Meta/t/data-valid/META-1_4.yml
+cpan/CPAN-Meta/t/data-valid/META-2.json
 cpan/CPAN-Meta/t/data-valid/scalar-meta-spec.yml
+cpan/CPAN-Meta/t/data-valid/x_deprecated-META.yml
+cpan/CPAN-Meta/t/lib/Parse/CPAN/Meta/Test.pm
 cpan/CPAN-Meta/t/load-bad.t
 cpan/CPAN-Meta/t/merge.t
 cpan/CPAN-Meta/t/meta-obj.t
 cpan/CPAN-Meta/t/no-index.t
 cpan/CPAN-Meta/t/optional_feature-merge.t
+cpan/CPAN-Meta/t/parse-cpan-meta/02_api.t
+cpan/CPAN-Meta/t/parse-cpan-meta/03_functions.t
+cpan/CPAN-Meta/t/parse-cpan-meta/04_export.t
+cpan/CPAN-Meta/t/parse-cpan-meta/05_errors.t
 cpan/CPAN-Meta/t/prereqs.t
 cpan/CPAN-Meta/t/prereqs-finalize.t
 cpan/CPAN-Meta/t/prereqs-merge.t
+cpan/CPAN-Meta/t/README-data.txt
 cpan/CPAN-Meta/t/repository.t
 cpan/CPAN-Meta/t/save-load.t
 cpan/CPAN-Meta/t/validator.t
@@ -1872,19 +1890,6 @@ cpan/parent/t/parent-classfromclassfile.t        tests for parent.pm
 cpan/parent/t/parent-classfromfile.t           tests for parent.pm
 cpan/parent/t/parent-pmc.t                     tests for parent.pm
 cpan/parent/t/parent-returns-false.t           tests for parent.pm
-cpan/Parse-CPAN-Meta/corpus/BadMETA.yml
-cpan/Parse-CPAN-Meta/corpus/bareyaml.meta
-cpan/Parse-CPAN-Meta/corpus/CL018_yaml.meta
-cpan/Parse-CPAN-Meta/corpus/json.meta
-cpan/Parse-CPAN-Meta/corpus/META-VR.json
-cpan/Parse-CPAN-Meta/corpus/META-VR.yml
-cpan/Parse-CPAN-Meta/corpus/yaml.meta
-cpan/Parse-CPAN-Meta/lib/Parse/CPAN/Meta.pm
-cpan/Parse-CPAN-Meta/t/02_api.t
-cpan/Parse-CPAN-Meta/t/03_functions.t
-cpan/Parse-CPAN-Meta/t/04_export.t
-cpan/Parse-CPAN-Meta/t/05_errors.t
-cpan/Parse-CPAN-Meta/t/lib/Parse/CPAN/Meta/Test.pm
 cpan/Perl-OSType/lib/Perl/OSType.pm                    Perl::OSType
 cpan/Perl-OSType/t/OSType.t                    Perl::OSType
 cpan/perlfaq/lib/perlfaq.pm    Perl frequently asked questions
index 1a59e09..07d45c1 100755 (executable)
@@ -305,14 +305,12 @@ use File::Glob qw(:case);
     # Note: When updating CPAN-Meta the META.* files will need to be regenerated
     # perl -Icpan/CPAN-Meta/lib Porting/makemeta
     'CPAN::Meta' => {
-        'DISTRIBUTION' => 'DAGOLDEN/CPAN-Meta-2.150005.tar.gz',
+        'DISTRIBUTION' => 'DAGOLDEN/CPAN-Meta-2.150010.tar.gz',
         'FILES'        => q[cpan/CPAN-Meta],
         'EXCLUDED'     => [
             qw[t/00-report-prereqs.t
                t/00-report-prereqs.dd
-               t/data-test/x_deprecated-META.json
-               t/data-valid/x_deprecated-META.yml
-               t/README-data.txt],
+              ],
             qr{^xt},
             qr{^history},
         ],
@@ -898,16 +896,6 @@ use File::Glob qw(:case);
         'FILES'        => q[cpan/parent],
     },
 
-    'Parse::CPAN::Meta' => {
-        'DISTRIBUTION' => 'DAGOLDEN/Parse-CPAN-Meta-1.4422.tar.gz',
-        'FILES'        => q[cpan/Parse-CPAN-Meta],
-        'EXCLUDED'     => [
-            qw[t/00-report-prereqs.dd],
-            qw[t/00-report-prereqs.t],
-            qr{^xt},
-        ],
-    },
-
     'PathTools' => {
         'DISTRIBUTION' => 'RJBS/PathTools-3.62.tar.gz',
         'FILES'        => q[dist/PathTools],
diff --git a/cpan/CPAN-Meta/corpus/BadMETA.yml b/cpan/CPAN-Meta/corpus/BadMETA.yml
new file mode 100644 (file)
index 0000000..ef0b0f8
--- /dev/null
@@ -0,0 +1,24 @@
+---
+abstract: ~
+author:
+  - 'Olivier MenguĂ©'
+build_requires:
+  ExtUtils::MakeMaker: 6.36
+configure_requires:
+  ExtUtils::MakeMaker: 6.36
+distribution_type: module
+dynamic_config: 1
+generated_by: 'Module::Install version 1.06'
+license: perl
+meta-spec:
+  url: http://module-build.sourceforge.net/META-spec-v1.4.html
+  version: 1.4
+name: Foo
+no_index:
+  directory:
+    - inc
+requires:
+  perl: 5.005
+resources:
+  license: http://dev.perl.org/licenses/
+version: 0.01
index 03806bc..0a52dcc 100644 (file)
@@ -3,7 +3,7 @@ use strict;
 use warnings;
 package CPAN::Meta::Converter;
 
-our $VERSION = '2.150005';
+our $VERSION = '2.150010';
 
 #pod =head1 SYNOPSIS
 #pod
@@ -43,22 +43,36 @@ BEGIN {
 # Perl 5.10.0 didn't have "is_qv" in version.pm
 *_is_qv = version->can('is_qv') ? sub { $_[0]->is_qv } : sub { exists $_[0]->{qv} };
 
+# We limit cloning to a maximum depth to bail out on circular data
+# structures.  While actual cycle detection might be technically better,
+# we expect circularity in META data structures to be rare and generally
+# the result of user error.  Therefore, a depth counter is lower overhead.
+our $DCLONE_MAXDEPTH = 1024;
+our $_CLONE_DEPTH;
+
 sub _dclone {
-  my $ref = shift;
-
-  # if an object is in the data structure and doesn't specify how to
-  # turn itself into JSON, we just stringify the object.  That does the
-  # right thing for typical things that might be there, like version objects,
-  # Path::Class objects, etc.
-  no warnings 'once';
-  no warnings 'redefine';
-  local *UNIVERSAL::TO_JSON = sub { "$_[0]" };
-
-  my $json = Parse::CPAN::Meta->json_backend()->new
-      ->utf8
-      ->allow_blessed
-      ->convert_blessed;
-  $json->decode($json->encode($ref))
+  my ( $ref  ) = @_;
+  return $ref unless my $reftype = ref $ref;
+
+  local $_CLONE_DEPTH = defined $_CLONE_DEPTH ? $_CLONE_DEPTH - 1 : $DCLONE_MAXDEPTH;
+  die "Depth Limit $DCLONE_MAXDEPTH Exceeded" if $_CLONE_DEPTH == 0;
+
+  return [ map { _dclone( $_ ) } @{$ref} ] if 'ARRAY' eq $reftype;
+  return { map { $_ => _dclone( $ref->{$_} ) } keys %{$ref} } if 'HASH' eq $reftype;
+
+  if ( 'SCALAR' eq $reftype ) {
+    my $new = _dclone(${$ref});
+    return \$new;
+  }
+
+  # We can't know if TO_JSON gives us cloned data, so refs must recurse
+  if ( eval { $ref->can('TO_JSON') } ) {
+    my $data = $ref->TO_JSON;
+    return ref $data ? _dclone( $data ) : $data;
+  }
+
+  # Just stringify everything else
+  return "$ref";
 }
 
 my %known_specs = (
@@ -333,7 +347,7 @@ sub _no_index_directory {
   my ($element, $key, $meta, $version) = @_;
   return unless $element;
 
-  # cleanup wrong format
+  # clean up wrong format
   if ( ! ref $element ) {
     my $item = $element;
     $element = { directory => [ $item ], file => [ $item ] };
@@ -421,7 +435,7 @@ sub _version_map {
   }
   elsif ( ref $element eq 'ARRAY' ) {
     my $hashref = { map { $_ => 0 } @$element };
-    return _version_map($hashref); # cleanup any weird stuff
+    return _version_map($hashref); # clean up any weird stuff
   }
   elsif ( ref $element eq '' && length $element ) {
     return { $element => 0 }
@@ -1499,7 +1513,7 @@ CPAN::Meta::Converter - Convert CPAN distribution metadata structures
 
 =head1 VERSION
 
-version 2.150005
+version 2.150010
 
 =head1 SYNOPSIS
 
@@ -1622,11 +1636,15 @@ David Golden <dagolden@cpan.org>
 
 Ricardo Signes <rjbs@cpan.org>
 
+=item *
+
+Adam Kennedy <adamk@cpan.org>
+
 =back
 
 =head1 COPYRIGHT AND LICENSE
 
-This software is copyright (c) 2010 by David Golden and Ricardo Signes.
+This software is copyright (c) 2010 by David Golden, Ricardo Signes, Adam Kennedy and Contributors.
 
 This is free software; you can redistribute it and/or modify it under
 the same terms as the Perl 5 programming language system itself.
index 9dac4f4..f610349 100644 (file)
@@ -3,7 +3,7 @@ use strict;
 use warnings;
 package CPAN::Meta::Feature;
 
-our $VERSION = '2.150005';
+our $VERSION = '2.150010';
 
 use CPAN::Meta::Prereqs;
 
@@ -77,7 +77,7 @@ CPAN::Meta::Feature - an optional feature provided by a CPAN distribution
 
 =head1 VERSION
 
-version 2.150005
+version 2.150010
 
 =head1 DESCRIPTION
 
@@ -132,11 +132,15 @@ David Golden <dagolden@cpan.org>
 
 Ricardo Signes <rjbs@cpan.org>
 
+=item *
+
+Adam Kennedy <adamk@cpan.org>
+
 =back
 
 =head1 COPYRIGHT AND LICENSE
 
-This software is copyright (c) 2010 by David Golden and Ricardo Signes.
+This software is copyright (c) 2010 by David Golden, Ricardo Signes, Adam Kennedy and Contributors.
 
 This is free software; you can redistribute it and/or modify it under
 the same terms as the Perl 5 programming language system itself.
index f4cac5e..aeeade9 100644 (file)
@@ -4,7 +4,7 @@ use strict;
 use warnings;
 package CPAN::Meta::History;
 
-our $VERSION = '2.150005';
+our $VERSION = '2.150010';
 
 1;
 
@@ -22,7 +22,7 @@ CPAN::Meta::History - history of CPAN Meta Spec changes
 
 =head1 VERSION
 
-version 2.150005
+version 2.150010
 
 =head1 DESCRIPTION
 
@@ -304,11 +304,15 @@ David Golden <dagolden@cpan.org>
 
 Ricardo Signes <rjbs@cpan.org>
 
+=item *
+
+Adam Kennedy <adamk@cpan.org>
+
 =back
 
 =head1 COPYRIGHT AND LICENSE
 
-This software is copyright (c) 2010 by David Golden and Ricardo Signes.
+This software is copyright (c) 2010 by David Golden, Ricardo Signes, Adam Kennedy and Contributors.
 
 This is free software; you can redistribute it and/or modify it under
 the same terms as the Perl 5 programming language system itself.
index cd3bb9c..5932f5a 100644 (file)
@@ -21,7 +21,12 @@ Conversion from the original HTML to POD format
 =item *
 
 Include list of valid licenses from L<Module::Build> 0.17 rather than
-linking to the module.
+linking to the module, with minor updates to text and links to reflect
+versions at the time of publication.
+
+=item *
+
+Fixed some dead links to point to active resources.
 
 =back
 
@@ -43,16 +48,17 @@ install it.
 
 F<META.yml> files are written in the L<YAML|http://www.yaml.org/> format.  The
 reasons we chose YAML instead of, say, XML or Data::Dumper are discussed in
-L<this thread|http://archive.develooper.com/makemaker@perl.org/msg00405.html>
+L<this thread|http://www.nntp.perl.org/group/perl.makemaker/2002/04/msg406.html>
 on the MakeMaker mailing list.
 
-The first line of a F<META.yml> file should be a valid L<YAML document header|http://www.yaml.org/spec/#.Document>
+The first line of a F<META.yml> file should be a valid
+L<YAML document header|http://yaml.org/spec/history/2002-10-31.html#syntax-document>
 like C<"--- #YAML:1.0">
 
 =head1 Fields
 
 The rest of the META.yml file is one big YAML
-L<mapping|http://www.yaml.org/spec/#.-syntax-mapping-Mapping->,
+L<mapping|http://yaml.org/spec/history/2002-10-31.html#syntax-mapping>,
 whose keys are described here.
 
 =over 4
@@ -87,28 +93,29 @@ Must be one of the following licenses:
 
 The distribution may be copied and redistributed under the same terms as perl
 itself (this is by far the most common licensing option for modules on CPAN).
-This is a dual license, in which the user may choose between either the GPL or
-the Artistic license.
+This is a dual license, in which the user may choose between either the GPL
+version 1 or the Artistic version 1 license.
 
 =item gpl
 
-The distribution is distributed under the terms of the Gnu General Public
-License (L<http://www.opensource.org/licenses/gpl-license.php>).
+The distribution is distributed under the terms of the GNU General Public
+License version 2 (L<http://opensource.org/licenses/GPL-2.0>).
 
 =item lgpl
 
-The distribution is distributed under the terms of the Gnu Lesser General
-Public License (L<http://www.opensource.org/licenses/lgpl-license.php>).
+The distribution is distributed under the terms of the GNU Lesser General
+Public License version 2 (L<http://opensource.org/licenses/LGPL-2.1>).
 
 =item artistic
 
-The distribution is licensed under the Artistic License, as specified by the
-Artistic file in the standard perl distribution.
+The distribution is licensed under the Artistic License version 1, as specified
+by the Artistic file in the standard perl distribution
+(L<http://opensource.org/licenses/Artistic-Perl-1.0>).
 
 =item bsd
 
-The distribution is licensed under the BSD License
-(L<http://www.opensource.org/licenses/bsd-license.php>).
+The distribution is licensed under the BSD 3-Clause License
+(L<http://opensource.org/licenses/BSD-3-Clause>).
 
 =item open_source
 
@@ -118,7 +125,7 @@ license listed at L<http://www.opensource.org/licenses/>.
 =item unrestricted
 
 The distribution is licensed under a license that is B<not> approved by
-L<www.opensource.org|http://www.opensource.org> but that allows distribution
+L<www.opensource.org|http://www.opensource.org/> but that allows distribution
 without restrictions.
 
 =item restrictive
@@ -143,10 +150,11 @@ Example:
   Data::Dumper: 0
   File::Find: 1.03
 
-A YAML L<mapping|http://www.yaml.org/spec/#.-syntax-mapping-Mapping->
+A YAML L<mapping|http://yaml.org/spec/history/2002-10-31.html#syntax-mapping>
 indicating the Perl modules this distribution requires for proper
 operation.  The keys are the module names, and the values are version
-specifications as described in the L<Module::Build|documentation for Module::Build's "requires" parameter>.
+specifications as described in the
+L<documentation for Module::Build's "requires" parameter|Module::Build::API/requires>.
 
 I<Note: the exact nature of the fancy specifications like
 C<< ">= 1.2, != 1.5, < 2.0" >> is subject to
@@ -160,7 +168,7 @@ Example:
   Data::Dumper: 0
   File::Find: 1.03
 
-A YAML L<mapping|http://www.yaml.org/spec/#.-syntax-mapping-Mapping->
+A YAML L<mapping|http://yaml.org/spec/history/2002-10-31.html#syntax-mapping>
 indicating the Perl modules this distribution recommends for enhanced
 operation.
 
@@ -171,7 +179,7 @@ Example:
   Data::Dumper: 0
   File::Find: 1.03
 
-A YAML L<mapping|http://www.yaml.org/spec/#.-syntax-mapping-Mapping->
+A YAML L<mapping|http://yaml.org/spec/history/2002-10-31.html#syntax-mapping>
 indicating the Perl modules required for building and/or testing of
 this distribution.  These dependencies are not required after the
 module is installed.
@@ -183,7 +191,7 @@ Example:
   Data::Dumper: 0
   File::Find: 1.03
 
-A YAML L<mapping|http://www.yaml.org/spec/#.-syntax-mapping-Mapping->
+A YAML L<mapping|http://yaml.org/spec/history/2002-10-31.html#syntax-mapping>
 indicating the Perl modules that cannot be installed while this
 distribution is installed.  This is a pretty uncommon situation.
 
@@ -200,7 +208,7 @@ sensing the environment, etc.) as part of its build/install process.
 
 Currently L<Module::Build> doesn't actually do anything with
 this flag - it's probably going to be up to higher-level tools like
-L<CPAN|CPAN.pm> to do something useful with it.  It can potentially
+L<CPAN.pm|CPAN> to do something useful with it.  It can potentially
 bring lots of security, packaging, and convenience improvements.
 
 =item generated_by
index 7b4b2f4..e0428a5 100644 (file)
@@ -21,7 +21,12 @@ Conversion from the original HTML to POD format
 =item *
 
 Include list of valid licenses from L<Module::Build> 0.18 rather than
-linking to the module.
+linking to the module, with minor updates to text and links to reflect
+versions at the time of publication.
+
+=item *
+
+Fixed some dead links to point to active resources.
 
 =back
 
@@ -43,16 +48,17 @@ install it.
 
 F<META.yml> files are written in the L<YAML|http://www.yaml.org/> format.  The
 reasons we chose YAML instead of, say, XML or Data::Dumper are discussed in
-L<this thread|http://archive.develooper.com/makemaker@perl.org/msg00405.html>
+L<this thread|http://www.nntp.perl.org/group/perl.makemaker/2002/04/msg406.html>
 on the MakeMaker mailing list.
 
-The first line of a F<META.yml> file should be a valid L<YAML document header|http://www.yaml.org/spec/#.Document>
+The first line of a F<META.yml> file should be a valid
+L<YAML document header|http://yaml.org/spec/history/2002-10-31.html#syntax-document>
 like C<"--- #YAML:1.0">
 
 =head1 Fields
 
 The rest of the META.yml file is one big YAML
-L<mapping|http://www.yaml.org/spec/#.-syntax-mapping-Mapping->,
+L<mapping|http://yaml.org/spec/history/2002-10-31.html#syntax-mapping>,
 whose keys are described here.
 
 =over 4
@@ -102,28 +108,29 @@ Must be one of the following licenses:
 
 The distribution may be copied and redistributed under the same terms as perl
 itself (this is by far the most common licensing option for modules on CPAN).
-This is a dual license, in which the user may choose between either the GPL or
-the Artistic license.
+This is a dual license, in which the user may choose between either the GPL
+version 1 or the Artistic version 1 license.
 
 =item gpl
 
-The distribution is distributed under the terms of the Gnu General Public
-License (L<http://www.opensource.org/licenses/gpl-license.php>).
+The distribution is distributed under the terms of the GNU General Public
+License version 2 (L<http://opensource.org/licenses/GPL-2.0>).
 
 =item lgpl
 
-The distribution is distributed under the terms of the Gnu Lesser General
-Public License (L<http://www.opensource.org/licenses/lgpl-license.php>).
+The distribution is distributed under the terms of the GNU Lesser General
+Public License version 2 (L<http://opensource.org/licenses/LGPL-2.1>).
 
 =item artistic
 
-The distribution is licensed under the Artistic License, as specified by the
-Artistic file in the standard perl distribution.
+The distribution is licensed under the Artistic License version 1, as specified
+by the Artistic file in the standard perl distribution
+(L<http://opensource.org/licenses/Artistic-Perl-1.0>).
 
 =item bsd
 
-The distribution is licensed under the BSD License
-(L<http://www.opensource.org/licenses/bsd-license.php>).
+The distribution is licensed under the BSD 3-Clause License
+(L<http://opensource.org/licenses/BSD-3-Clause>).
 
 =item open_source
 
@@ -133,7 +140,7 @@ license listed at L<http://www.opensource.org/licenses/>.
 =item unrestricted
 
 The distribution is licensed under a license that is B<not> approved by
-L<www.opensource.org|http://www.opensource.org> but that allows distribution
+L<www.opensource.org|http://www.opensource.org/> but that allows distribution
 without restrictions.
 
 =item restrictive
@@ -175,10 +182,11 @@ Example:
   Data::Dumper: 0
   File::Find: 1.03
 
-A YAML L<mapping|http://www.yaml.org/spec/#.-syntax-mapping-Mapping->
+A YAML L<mapping|http://yaml.org/spec/history/2002-10-31.html#syntax-mapping>
 indicating the Perl modules this distribution requires for proper
 operation.  The keys are the module names, and the values are version
-specifications as described in the L<Module::Build|documentation for Module::Build's "requires" parameter>.
+specifications as described in the
+L<documentation for Module::Build's "requires" parameter|Module::Build::API/requires>.
 
 I<Note: the exact nature of the fancy specifications like
 C<< ">= 1.2, != 1.5, < 2.0" >> is subject to
@@ -192,7 +200,7 @@ Example:
   Data::Dumper: 0
   File::Find: 1.03
 
-A YAML L<mapping|http://www.yaml.org/spec/#.-syntax-mapping-Mapping->
+A YAML L<mapping|http://yaml.org/spec/history/2002-10-31.html#syntax-mapping>
 indicating the Perl modules this distribution recommends for enhanced
 operation.
 
@@ -203,7 +211,7 @@ Example:
   Data::Dumper: 0
   File::Find: 1.03
 
-A YAML L<mapping|http://www.yaml.org/spec/#.-syntax-mapping-Mapping->
+A YAML L<mapping|http://yaml.org/spec/history/2002-10-31.html#syntax-mapping>
 indicating the Perl modules required for building and/or testing of
 this distribution.  These dependencies are not required after the
 module is installed.
@@ -215,7 +223,7 @@ Example:
   Data::Dumper: 0
   File::Find: 1.03
 
-A YAML L<mapping|http://www.yaml.org/spec/#.-syntax-mapping-Mapping->
+A YAML L<mapping|http://yaml.org/spec/history/2002-10-31.html#syntax-mapping>
 indicating the Perl modules that cannot be installed while this
 distribution is installed.  This is a pretty uncommon situation.
 
@@ -239,7 +247,7 @@ sensing the environment, etc.) as part of its build/install process.
 
 Currently L<Module::Build> doesn't actually do anything with
 this flag - it's probably going to be up to higher-level tools like
-L<CPAN|CPAN.pm> to do something useful with it.  It can potentially
+L<CPAN.pm|CPAN> to do something useful with it.  It can potentially
 bring lots of security, packaging, and convenience improvements.
 
 =item generated_by
index 48867b2..1cb471f 100644 (file)
@@ -21,7 +21,12 @@ Various spelling corrections
 =item *
 
 Include list of valid licenses from L<Module::Build> 0.2611 rather than
-linking to the module.
+linking to the module, with minor updates to text and links to reflect
+versions at the time of publication.
+
+=item *
+
+Fixed some dead links to point to active resources.
 
 =back
 
@@ -96,21 +101,15 @@ XML or Data::Dumper:
 
 =item *
 
-Module::Build design plans
-
-L<http://nntp.x.perl.org/group/perl.makemaker/406>
+L<Module::Build design plans|http://www.nntp.perl.org/group/perl.makemaker/2002/04/msg407.html>
 
 =item *
 
-Not keen on YAML
-
-L<http://nntp.x.perl.org/group/perl.module-authors/1353>
+L<Not keen on YAML|http://www.nntp.perl.org/group/perl.module-authors/2003/11/msg1353.html>
 
 =item *
 
-META Concerns
-
-L<http://nntp.x.perl.org/group/perl.module-authors/1385>
+L<META Concerns|http://www.nntp.perl.org/group/perl.module-authors/2003/11/msg1385.html>
 
 =back
 
@@ -136,8 +135,8 @@ well (ex. python, ruby).
 
 =head1 VERSION SPECIFICATIONS
 
-Some fields require a version specification (ex. L<"requires">,
-L<"recommends">, L<"build_requires">, etc.).  This section details the
+Some fields require a version specification (ex. L</requires>,
+L</recommends>, L</build_requires>, etc.).  This section details the
 version specifications that are currently supported.
 
 If a single version is listed, then that version is considered to be
@@ -242,28 +241,29 @@ Must be one of the following licenses:
 
 The distribution may be copied and redistributed under the same terms as perl
 itself (this is by far the most common licensing option for modules on CPAN).
-This is a dual license, in which the user may choose between either the GPL or
-the Artistic license.
+This is a dual license, in which the user may choose between either the GPL
+version 1 or the Artistic version 1 license.
 
 =item gpl
 
-The distribution is distributed under the terms of the Gnu General Public
-License (L<http://www.opensource.org/licenses/gpl-license.php>).
+The distribution is distributed under the terms of the GNU General Public
+License version 2 (L<http://opensource.org/licenses/GPL-2.0>).
 
 =item lgpl
 
-The distribution is distributed under the terms of the Gnu Lesser General
-Public License (L<http://www.opensource.org/licenses/lgpl-license.php>).
+The distribution is distributed under the terms of the GNU Lesser General
+Public License version 2 (L<http://opensource.org/licenses/LGPL-2.1>).
 
 =item artistic
 
-The distribution is licensed under the Artistic License, as specified by the
-Artistic file in the standard perl distribution.
+The distribution is licensed under the Artistic License version 1, as specified
+by the Artistic file in the standard perl distribution
+(L<http://opensource.org/licenses/Artistic-Perl-1.0>).
 
 =item bsd
 
-The distribution is licensed under the BSD License
-(L<http://www.opensource.org/licenses/bsd-license.php>).
+The distribution is licensed under the BSD 3-Clause License
+(L<http://opensource.org/licenses/BSD-3-Clause>).
 
 =item open_source
 
@@ -273,7 +273,7 @@ license listed at L<http://www.opensource.org/licenses/>.
 =item unrestricted
 
 The distribution is licensed under a license that is B<not> approved by
-L<www.opensource.org|http://www.opensource.org> but that allows distribution
+L<www.opensource.org|http://www.opensource.org/> but that allows distribution
 without restrictions.
 
 =item restrictive
@@ -341,9 +341,9 @@ Example:
 
 I<(Spec 1.1) [optional] {map} A YAML sequence of names for optional features
 which are made available when its requirements are met. For each
-feature a description is provided along with any of L<"requires">,
-L<"build_requires">, L<"conflicts">, L<"requires_packages">,
-L<"requires_os">, and L<"excludes_os"> which have the same meaning in
+feature a description is provided along with any of L</requires>,
+L</build_requires>, L</conflicts>, C<requires_packages>,
+C<requires_os>, and C<excludes_os> which have the same meaning in
 this subcontext as described elsewhere in this document.>
 
 =head2 build_requires
@@ -394,7 +394,7 @@ If this field is omitted, it defaults to 1 (true).
 =head2 private
 
 I<(Deprecated)> (Spec 1.0) [optional] {map} This field has been renamed to
-L</"no_index">.  See below.
+L</no_index>.  See below.
 
 =head2 provides
 
@@ -416,7 +416,7 @@ cases, is) used by distribution and automation mechanisms like PAUSE,
 CPAN, and search.cpan.org to build indexes saying in which
 distribution various packages can be found.
 
-When using tools like C<Module::Build> that can generate the
+When using tools like L<Module::Build> that can generate the
 C<provides> mapping for your distribution automatically, make sure you
 examine what it generates to make sure it makes sense - indexers will
 usually trust the C<provides> field if it's present, rather than
@@ -536,23 +536,23 @@ tool. RWS]
 
 =head1 SEE ALSO
 
-CPAN, L<http://www.cpan.org/>
+L<CPAN|http://www.cpan.org/>
 
-CPAN.pm, L<http://search.cpan.org/author/ANDK/CPAN/>
+L<CPAN.pm|CPAN>
 
-CPANPLUS, L<http://search.cpan.org/author/KANE/CPANPLUS/>
+L<CPANPLUS>
 
-Data::Dumper, L<http://search.cpan.org/author/ILYAM/Data-Dumper/>
+L<Data::Dumper>
 
-ExtUtils::MakeMaker, L<http://search.cpan.org/author/MSCHWERN/ExtUtils-MakeMaker/>
+L<ExtUtils::MakeMaker>
 
-Module::Build, L<http://search.cpan.org/author/KWILLIAMS/Module-Build/>
+L<Module::Build>
 
-Module::Install, L<http://search.cpan.org/author/KWILLIAMS/Module-Install/>
+L<Module::Install>
 
-XML, L<http://www.w3.org/XML/>
+L<XML|http://www.w3.org/XML/>
 
-YAML, L<http://www.yaml.org/>
+L<YAML|http://www.yaml.org/>
 
 =head1 HISTORY
 
@@ -574,7 +574,7 @@ Created version 1.0 of this document.
 
 =item *
 
-Added the L</"dynamic_config"> field, which was missing from the initial
+Added the L</dynamic_config> field, which was missing from the initial
 version.
 
 =back
@@ -594,12 +594,12 @@ L<http://nntp.x.perl.org/group/> site.
 
 =item *
 
-Added and deprecated the L<"private"> field.
+Added and deprecated the L</private> field.
 
 =item *
 
-Added L<"abstract">, L<"configure">, L<"requires_packages">,
-L<"requires_os">, L<"excludes_os">, and L<"no_index"> fields.
+Added L</abstract>, C<configure>, C<requires_packages>,
+C<requires_os>, C<excludes_os>, and L</no_index> fields.
 
 =item *
 
@@ -613,15 +613,15 @@ Bumped version.
 
 =item *
 
-Added L<"generation">, L<"authored_by"> fields.
+Added C<generation>, C<authored_by> fields.
 
 =item *
 
-Add alternative proposal to the L<"recommends"> field.
+Add alternative proposal to the L</recommends> field.
 
 =item *
 
-Add proposal for a L<"requires_build_tools"> field.
+Add proposal for a C<requires_build_tools> field.
 
 =back
 
@@ -635,7 +635,7 @@ Added link to latest version of this specification on CPAN.
 
 =item *
 
-Added section L<"VERSION SPECIFICATIONS">.
+Added section L</"VERSION SPECIFICATIONS">.
 
 =item *
 
@@ -643,7 +643,7 @@ Chang name from Module::Build::META-spec to CPAN::META::Specification.
 
 =item *
 
-Add proposal for L<"auto_regenerate"> field.
+Add proposal for C<auto_regenerate> field.
 
 =back
 
@@ -653,15 +653,15 @@ Add proposal for L<"auto_regenerate"> field.
 
 =item *
 
-Add L<"index"> field as a compliment to L<"no_index">
+Add C<index> field as a compliment to L</no_index>
 
 =item *
 
-Add L<"keywords"> field as a means to aid searching distributions.
+Add L</keywords> field as a means to aid searching distributions.
 
 =item *
 
-Add L<"TERMINOLOGY"> section to explain certain terms that may be
+Add L</TERMINOLOGY> section to explain certain terms that may be
 ambiguous.
 
 =back
@@ -679,7 +679,7 @@ more like records of brainstorming.
 
 =item *
 
-Changed C<authored_by> to C<author>, since that's always been what
+Changed C<authored_by> to L</author>, since that's always been what
 it's actually called in actual F<META.yml> files.
 
 =item *
@@ -689,12 +689,12 @@ operators.
 
 =item *
 
-Noted that the C<distribution_type> field is basically meaningless,
+Noted that the L</distribution_type> field is basically meaningless,
 and shouldn't really be used.
 
 =item *
 
-Clarified C<dynamic_config> a bit.
+Clarified L</dynamic_config> a bit.
 
 =back
 
index b075adc..9e889cd 100644 (file)
@@ -21,7 +21,12 @@ Various spelling corrections
 =item *
 
 Include list of valid licenses from L<Module::Build> 0.2805 rather than
-linking to the module.
+linking to the module, with minor updates to text and links to reflect
+versions at the time of publication.
+
+=item *
+
+Fixed some dead links to point to active resources.
 
 =back
 
@@ -94,17 +99,17 @@ XML or Data::Dumper:
 
 =over 4
 
-=item Module::Build design plans
+=item *
 
-L<http://nntp.x.perl.org/group/perl.makemaker/406>
+L<Module::Build design plans|http://www.nntp.perl.org/group/perl.makemaker/2002/04/msg407.html>
 
-=item Not keen on YAML
+=item *
 
-L<http://nntp.x.perl.org/group/perl.module-authors/1353>
+L<Not keen on YAML|http://www.nntp.perl.org/group/perl.module-authors/2003/11/msg1353.html>
 
-=item META Concerns
+=item *
 
-L<http://nntp.x.perl.org/group/perl.module-authors/1385>
+L<META Concerns|http://www.nntp.perl.org/group/perl.module-authors/2003/11/msg1385.html>
 
 =back
 
@@ -206,39 +211,40 @@ Must be one of the following licenses:
 
 =item apache
 
-The distribution is licensed under the Apache Software License
-(L<http://opensource.org/licenses/apachepl.php>).
+The distribution is licensed under the Apache Software License version 1.1
+(L<http://opensource.org/licenses/Apache-1.1>).
 
 =item artistic
 
-The distribution is licensed under the Artistic License, as specified by the
-Artistic file in the standard perl distribution.
+The distribution is licensed under the Artistic License version 1, as specified
+by the Artistic file in the standard perl distribution
+(L<http://opensource.org/licenses/Artistic-Perl-1.0>).
 
 =item bsd
 
-The distribution is licensed under the BSD License
-(L<http://www.opensource.org/licenses/bsd-license.php>).
+The distribution is licensed under the BSD 3-Clause License
+(L<http://opensource.org/licenses/BSD-3-Clause>).
 
 =item gpl
 
-The distribution is licensed under the terms of the Gnu General Public License
-(L<http://www.opensource.org/licenses/gpl-license.php>).
+The distribution is distributed under the terms of the GNU General Public
+License version 2 (L<http://opensource.org/licenses/GPL-2.0>).
 
 =item lgpl
 
-The distribution is licensed under the terms of the Gnu Lesser General Public
-License (L<http://www.opensource.org/licenses/lgpl-license.php>).
+The distribution is distributed under the terms of the GNU Lesser General
+Public License version 2 (L<http://opensource.org/licenses/LGPL-2.1>).
 
 =item mit
 
 The distribution is licensed under the MIT License
-(L<http://opensource.org/licenses/mit-license.php>).
+(L<http://opensource.org/licenses/MIT>).
 
 =item mozilla
 
 The distribution is licensed under the Mozilla Public License.
-(L<http://opensource.org/licenses/mozilla1.0.php> or
-L<http://opensource.org/licenses/mozilla1.1.php>)
+(L<http://opensource.org/licenses/MPL-1.0> or
+L<http://opensource.org/licenses/MPL-1.1>)
 
 =item open_source
 
@@ -249,8 +255,8 @@ license listed at L<http://www.opensource.org/licenses/>.
 
 The distribution may be copied and redistributed under the same terms as perl
 itself (this is by far the most common licensing option for modules on CPAN).
-This is a dual license, in which the user may choose between either the GPL or
-the Artistic license.
+This is a dual license, in which the user may choose between either the GPL
+version 1 or the Artistic version 1 license.
 
 =item restrictive
 
@@ -292,7 +298,7 @@ Example:
 (Spec 1.0) [optional] {map} A YAML mapping indicating the Perl modules this
 distribution requires for proper operation.  The keys are the module
 names, and the values are version specifications as described in
-L<VERSION SPECIFICATIONS>.
+L</"VERSION SPECIFICATIONS">.
 
 =head2 recommends
 
@@ -305,7 +311,7 @@ Example:
 (Spec 1.0) [optional] {map} A YAML mapping indicating the Perl modules
 this distribution recommends for enhanced operation.  The keys are the
 module names, and the values are version specifications as described
-in L<VERSION SPECIFICATIONS>.
+in L</"VERSION SPECIFICATIONS">.
 
 
 
@@ -327,9 +333,9 @@ Example:
 
 I<(Spec 1.1) [optional] {map} A YAML sequence of names for optional features
 which are made available when its requirements are met. For each
-feature a description is provided along with any of L<"requires">,
-L<"build_requires">, L<"conflicts">, L<"requires_packages">,
-L<"requires_os">, and L<"excludes_os"> which have the same meaning in
+feature a description is provided along with any of L</requires>,
+L</build_requires>, L</conflicts>, C<requires_packages>,
+C<requires_os>, and C<excludes_os> which have the same meaning in
 this subcontext as described elsewhere in this document.>
 
 =head2 build_requires
@@ -343,7 +349,7 @@ Example:
 (Spec 1.0) [optional] {map} A YAML mapping indicating the Perl modules
 required for building and/or testing of this distribution.  The keys
 are the module names, and the values are version specifications as
-described in L<VERSION SPECIFICATIONS>.  These dependencies are not
+described in L</"VERSION SPECIFICATIONS">.  These dependencies are not
 required after the module is installed.
 
 =head2 conflicts
@@ -358,7 +364,7 @@ Example:
 cannot be installed while this distribution is installed.  This is a
 pretty uncommon situation.  The keys for C<conflicts> are the module
 names, and the values are version specifications as described in
-L<VERSION SPECIFICATIONS>.
+L</"VERSION SPECIFICATIONS">.
 
 
 =head2 dynamic_config
@@ -385,7 +391,7 @@ If this field is omitted, it defaults to 1 (true).
 =head2 private
 
 I<(Deprecated)> (Spec 1.0) [optional] {map} This field has been renamed to
-L</"no_index">.  See below.
+L</no_index>.  See below.
 
 =head2 provides
 
@@ -407,7 +413,7 @@ cases, is) used by distribution and automation mechanisms like PAUSE,
 CPAN, and search.cpan.org to build indexes saying in which
 distribution various packages can be found.
 
-When using tools like C<Module::Build> that can generate the
+When using tools like L<Module::Build> that can generate the
 C<provides> mapping for your distribution automatically, make sure you
 examine what it generates to make sure it makes sense - indexers will
 usually trust the C<provides> field if it's present, rather than
@@ -437,7 +443,7 @@ directories, packages, and namespaces that are private
 and indexing tools.  This is useful when no C<provides> field is
 present.
 
-For example, C<search.cpan.org> excludes items listed in C<no_index>
+For example, L<http://search.cpan.org/> excludes items listed in C<no_index>
 when searching for POD, meaning files in these directories will not
 converted to HTML and made public - which is useful if you have
 example or test PODs that you don't want the search engine to go
@@ -534,8 +540,8 @@ tool. RWS]
 
 =head1 VERSION SPECIFICATIONS
 
-Some fields require a version specification (ex. L<"requires">,
-L<"recommends">, L<"build_requires">, etc.) to indicate the particular
+Some fields require a version specification (ex. L</requires>,
+L</recommends>, L</build_requires>, etc.) to indicate the particular
 versionZ<>(s) of some other module that may be required as a
 prerequisite.  This section details the version specification formats
 that are currently supported.
@@ -559,23 +565,23 @@ together using commas.  The specification C<E<gt>= 1.2, != 1.5, E<lt>
 
 =head1 SEE ALSO
 
-CPAN, L<http://www.cpan.org/>
+L<CPAN|http://www.cpan.org/>
 
-CPAN.pm, L<http://search.cpan.org/dist/CPAN/>
+L<CPAN.pm|CPAN>
 
-CPANPLUS, L<http://search.cpan.org/dist/CPANPLUS/>
+L<CPANPLUS>
 
-Data::Dumper, L<http://search.cpan.org/dist/Data-Dumper/>
+L<Data::Dumper>
 
-ExtUtils::MakeMaker, L<http://search.cpan.org/dist/ExtUtils-MakeMaker/>
+L<ExtUtils::MakeMaker>
 
-Module::Build, L<http://search.cpan.org/dist/Module-Build/>
+L<Module::Build>
 
-Module::Install, L<http://search.cpan.org/dist/Module-Install/>
+L<Module::Install>
 
-XML, L<http://www.w3.org/XML/>
+L<XML|http://www.w3.org/XML/>
 
-YAML, L<http://www.yaml.org/>
+L<YAML|http://www.yaml.org/>
 
 =head1 HISTORY
 
@@ -597,7 +603,7 @@ Created version 1.0 of this document.
 
 =item *
 
-Added the L</"dynamic_config"> field, which was missing from the initial
+Added the L</dynamic_config> field, which was missing from the initial
 version.
 
 =back
@@ -617,12 +623,12 @@ L<http://nntp.x.perl.org/group/> site.
 
 =item *
 
-Added and deprecated the L<"private"> field.
+Added and deprecated the L</private> field.
 
 =item *
 
-Added L<"abstract">, L<"configure">, L<"requires_packages">,
-L<"requires_os">, L<"excludes_os">, and L<"no_index"> fields.
+Added L</abstract>, C<configure>, C<requires_packages>,
+C<requires_os>, C<excludes_os>, and L</no_index> fields.
 
 =item *
 
@@ -636,15 +642,15 @@ Bumped version.
 
 =item *
 
-Added L<"generation">, L<"authored_by"> fields.
+Added C<generation>, C<authored_by> fields.
 
 =item *
 
-Add alternative proposal to the L<"recommends"> field.
+Add alternative proposal to the L</recommends> field.
 
 =item *
 
-Add proposal for a L<"requires_build_tools"> field.
+Add proposal for a C<requires_build_tools> field.
 
 =back
 
@@ -658,7 +664,7 @@ Added link to latest version of this specification on CPAN.
 
 =item *
 
-Added section L<"VERSION SPECIFICATIONS">.
+Added section L</"VERSION SPECIFICATIONS">.
 
 =item *
 
@@ -666,7 +672,7 @@ Chang name from Module::Build::META-spec to CPAN::META::Specification.
 
 =item *
 
-Add proposal for L<"auto_regenerate"> field.
+Add proposal for C<auto_regenerate> field.
 
 =back
 
@@ -676,15 +682,15 @@ Add proposal for L<"auto_regenerate"> field.
 
 =item *
 
-Add L<"index"> field as a compliment to L<"no_index">
+Add C<index> field as a compliment to L</no_index>
 
 =item *
 
-Add L<"keywords"> field as a means to aid searching distributions.
+Add L</keywords> field as a means to aid searching distributions.
 
 =item *
 
-Add L<"TERMINOLOGY"> section to explain certain terms that may be
+Add L</TERMINOLOGY> section to explain certain terms that may be
 ambiguous.
 
 =back
@@ -702,7 +708,7 @@ more like records of brainstorming.
 
 =item *
 
-Changed C<authored_by> to C<author>, since that's always been what
+Changed C<authored_by> to L</author>, since that's always been what
 it's actually called in actual F<META.yml> files.
 
 =item *
@@ -712,12 +718,12 @@ operators.
 
 =item *
 
-Noted that the C<distribution_type> field is basically meaningless,
+Noted that the L</distribution_type> field is basically meaningless,
 and shouldn't really be used.
 
 =item *
 
-Clarified C<dynamic_config> a bit.
+Clarified L</dynamic_config> a bit.
 
 =back
 
index 471296c..932f1ed 100644 (file)
@@ -21,7 +21,12 @@ Various spelling corrections
 =item *
 
 Include list of valid licenses from L<Module::Build> 0.2807 rather than
-linking to the module.
+linking to the module, with minor updates to text and links to reflect
+versions at the time of publication.
+
+=item *
+
+Fixed some dead links to point to active resources.
 
 =back
 
@@ -84,35 +89,6 @@ and the latest development version (which may include things that
 won't make it into the stable version) can always be found at
 L<http://module-build.sourceforge.net/META-spec-blead.html>.>
 
-=begin MAINTAINER
-
-The master source for the META spec is META-spec.pod.  META-spec.html
-is built (manually) from META-spec.pod whenever there are changes, and
-the two files should generally be checked in together.  Ideally it
-would happen through a trigger or something, but it doesn't.
-
-Ken has a cron job that copies the latest bleeding-edge version of the
-spec (HTML version) to Sourceforge whenever his laptop is turned on:
-
-  21 * * * * svn cat http://svn.perl.org/modules/Module-Build/trunk/website/META-spec.html \
-       | ssh kwilliams@shell.sourceforge.net \
-       'cat > /home/groups/m/mo/module-build/htdocs/META-spec-blead.html'
-
-The numbered revisions of the spec at
-L<"http://module-build.sourceforge.net/"> are captures of the spec at
-opportune moments.  A couple of symlinks also exist for convenience:
-
- -rw-r--r--  1 kwilliams 24585 Oct 10 17:21 META-spec-blead.html
- lrwxrwxrwx  1 kwilliams    19 Jan 19  2007 META-spec-current.html -> META-spec-v1.3.html
- lrwxrwxrwx  1 kwilliams    22 Jan 19  2007 META-spec.html -> META-spec-current.html
- -rw-r--r--  1 kwilliams  5830 Jul 25  2005 META-spec-v1.0.html
- -rw-r--r--  1 kwilliams  7847 Jul 25  2005 META-spec-v1.1.html
- -rw-r--r--  1 kwilliams 22635 Aug 23  2005 META-spec-v1.2.html
- -rw-r--r--  1 kwilliams 24086 Nov  4  2006 META-spec-v1.3.html
-
-=end MAINTAINER
-
-
 =head1 FORMAT
 
 F<META.yml> files are written in the YAML format (see
@@ -123,17 +99,17 @@ XML or Data::Dumper:
 
 =over 4
 
-=item Module::Build design plans
+=item *
 
-L<http://nntp.x.perl.org/group/perl.makemaker/406>
+L<Module::Build design plans|http://www.nntp.perl.org/group/perl.makemaker/2002/04/msg407.html>
 
-=item Not keen on YAML
+=item *
 
-L<http://nntp.x.perl.org/group/perl.module-authors/1353>
+L<Not keen on YAML|http://www.nntp.perl.org/group/perl.module-authors/2003/11/msg1353.html>
 
-=item META Concerns
+=item *
 
-L<http://nntp.x.perl.org/group/perl.module-authors/1385>
+L<META Concerns|http://www.nntp.perl.org/group/perl.module-authors/2003/11/msg1385.html>
 
 =back
 
@@ -235,39 +211,40 @@ Must be one of the following licenses:
 
 =item apache
 
-The distribution is licensed under the Apache Software License
-(L<http://opensource.org/licenses/apachepl.php>).
+The distribution is licensed under the Apache Software License version 1.1
+(L<http://opensource.org/licenses/Apache-1.1>).
 
 =item artistic
 
-The distribution is licensed under the Artistic License, as specified by the
-Artistic file in the standard perl distribution.
+The distribution is licensed under the Artistic License version 1, as specified
+by the Artistic file in the standard perl distribution
+(L<http://opensource.org/licenses/Artistic-Perl-1.0>).
 
 =item bsd
 
-The distribution is licensed under the BSD License
-(L<http://www.opensource.org/licenses/bsd-license.php>).
+The distribution is licensed under the BSD 3-Clause License
+(L<http://opensource.org/licenses/BSD-3-Clause>).
 
 =item gpl
 
-The distribution is licensed under the terms of the Gnu General Public License
-(L<http://www.opensource.org/licenses/gpl-license.php>).
+The distribution is distributed under the terms of the GNU General Public
+License version 2 (L<http://opensource.org/licenses/GPL-2.0>).
 
 =item lgpl
 
-The distribution is licensed under the terms of the Gnu Lesser General Public
-License (L<http://www.opensource.org/licenses/lgpl-license.php>).
+The distribution is distributed under the terms of the GNU Lesser General
+Public License version 2 (L<http://opensource.org/licenses/LGPL-2.1>).
 
 =item mit
 
 The distribution is licensed under the MIT License
-(L<http://opensource.org/licenses/mit-license.php>).
+(L<http://opensource.org/licenses/MIT>).
 
 =item mozilla
 
 The distribution is licensed under the Mozilla Public License.
-(L<http://opensource.org/licenses/mozilla1.0.php> or
-L<http://opensource.org/licenses/mozilla1.1.php>)
+(L<http://opensource.org/licenses/MPL-1.0> or
+L<http://opensource.org/licenses/MPL-1.1>)
 
 =item open_source
 
@@ -355,8 +332,8 @@ Example:
 
 I<(Spec 1.1) [optional] {map} A YAML mapping of names for optional features
 which are made available when its requirements are met. For each
-feature a description is provided along with any of L<"requires">,
-L<"build_requires">, and L<"conflicts">, which have the same meaning in
+feature a description is provided along with any of L</requires>,
+L</build_requires>, and L</conflicts>, which have the same meaning in
 this subcontext as described elsewhere in this document.>
 
 =head2 build_requires
@@ -371,7 +348,7 @@ Example:
 prerequisites required for building and/or testing of this
 distribution.  The keys are the names of the prerequisites (module
 names or 'perl'), and the values are version specifications as
-described in L<VERSION SPECIFICATIONS>.  These dependencies are not
+described in L</"VERSION SPECIFICATIONS">.  These dependencies are not
 required after the distribution is installed.
 
 =head2 configure_requires
@@ -385,9 +362,9 @@ Example:
 
 (Spec 1.4) [optional] {map} A YAML mapping indicating the Perl prerequisites
 required before configuring this distribution.  The keys are the
-names of the prerequisites (module names or 'perl'), and the values are version specifications as described
-in L<VERSION SPECIFICATIONS>.  These dependencies are not required
-after the distribution is installed.
+names of the prerequisites (module names or 'perl'), and the values are version
+specifications as described in L</"VERSION SPECIFICATIONS">.  These
+dependencies are not required after the distribution is installed.
 
 =head2 conflicts
 
@@ -401,7 +378,7 @@ Example:
 cannot be installed while this distribution is installed.  This is a
 pretty uncommon situation.  The keys for C<conflicts> are the item
 names (module names or 'perl'), and the values are version
-specifications as described in L<VERSION SPECIFICATIONS>.
+specifications as described in L</"VERSION SPECIFICATIONS">.
 
 
 =head2 dynamic_config
@@ -428,7 +405,7 @@ If this field is omitted, it defaults to 1 (true).
 =head2 private
 
 I<(Deprecated)> (Spec 1.0) [optional] {map} This field has been renamed to
-L</"no_index">.  See below.
+L</no_index>.  See below.
 
 =head2 provides
 
@@ -450,7 +427,7 @@ cases, is) used by distribution and automation mechanisms like PAUSE,
 CPAN, and search.cpan.org to build indexes saying in which
 distribution various packages can be found.
 
-When using tools like C<Module::Build> that can generate the
+When using tools like L<Module::Build> that can generate the
 C<provides> mapping for your distribution automatically, make sure you
 examine what it generates to make sure it makes sense - indexers will
 usually trust the C<provides> field if it's present, rather than
@@ -480,7 +457,7 @@ directories, packages, and namespaces that are private
 and indexing tools.  This is useful when no C<provides> field is
 present.
 
-For example, C<search.cpan.org> excludes items listed in C<no_index>
+For example, L<http://search.cpan.org/> excludes items listed in C<no_index>
 when searching for POD, meaning files in these directories will not
 converted to HTML and made public - which is useful if you have
 example or test PODs that you don't want the search engine to go
@@ -577,8 +554,8 @@ tool. RWS]
 
 =head1 VERSION SPECIFICATIONS
 
-Some fields require a version specification (ex. L<"requires">,
-L<"recommends">, L<"build_requires">, etc.) to indicate the particular
+Some fields require a version specification (ex. L</requires>,
+L</recommends>, L</build_requires>, etc.) to indicate the particular
 versionZ<>(s) of some other module that may be required as a
 prerequisite.  This section details the version specification formats
 that are currently supported.
@@ -602,23 +579,23 @@ together using commas.  The specification C<E<gt>= 1.2, != 1.5, E<lt>
 
 =head1 SEE ALSO
 
-CPAN, L<http://www.cpan.org/>
+L<CPAN|http://www.cpan.org/>
 
-CPAN.pm, L<http://search.cpan.org/dist/CPAN/>
+L<CPAN.pm|CPAN>
 
-CPANPLUS, L<http://search.cpan.org/dist/CPANPLUS/>
+L<CPANPLUS>
 
-Data::Dumper, L<http://search.cpan.org/dist/Data-Dumper/>
+L<Data::Dumper>
 
-ExtUtils::MakeMaker, L<http://search.cpan.org/dist/ExtUtils-MakeMaker/>
+L<ExtUtils::MakeMaker>
 
-Module::Build, L<http://search.cpan.org/dist/Module-Build/>
+L<Module::Build>
 
-Module::Install, L<http://search.cpan.org/dist/Module-Install/>
+L<Module::Install>
 
-XML, L<http://www.w3.org/XML/>
+L<XML|http://www.w3.org/XML/>
 
-YAML, L<http://www.yaml.org/>
+L<YAML|http://www.yaml.org/>
 
 =head1 HISTORY
 
@@ -640,7 +617,7 @@ Created version 1.0 of this document.
 
 =item *
 
-Added the L</"dynamic_config"> field, which was missing from the initial
+Added the L</dynamic_config> field, which was missing from the initial
 version.
 
 =back
@@ -660,12 +637,12 @@ L<http://nntp.x.perl.org/group/> site.
 
 =item *
 
-Added and deprecated the L<"private"> field.
+Added and deprecated the L</private> field.
 
 =item *
 
-Added L<"abstract">, L<"configure">, L<"requires_packages">,
-L<"requires_os">, L<"excludes_os">, and L<"no_index"> fields.
+Added L</abstract>, C<configure>, C<requires_packages>,
+C<requires_os>, C<excludes_os>, and L</no_index> fields.
 
 =item *
 
@@ -679,15 +656,15 @@ Bumped version.
 
 =item *
 
-Added L<"generation">, L<"authored_by"> fields.
+Added C<generation>, C<authored_by> fields.
 
 =item *
 
-Add alternative proposal to the L<"recommends"> field.
+Add alternative proposal to the L</recommends> field.
 
 =item *
 
-Add proposal for a L<"requires_build_tools"> field.
+Add proposal for a C<requires_build_tools> field.
 
 =back
 
@@ -701,7 +678,7 @@ Added link to latest version of this specification on CPAN.
 
 =item *
 
-Added section L<"VERSION SPECIFICATIONS">.
+Added section L</"VERSION SPECIFICATIONS">.
 
 =item *
 
@@ -709,7 +686,7 @@ Chang name from Module::Build::META-spec to CPAN::META::Specification.
 
 =item *
 
-Add proposal for L<"auto_regenerate"> field.
+Add proposal for C<auto_regenerate> field.
 
 =back
 
@@ -719,15 +696,15 @@ Add proposal for L<"auto_regenerate"> field.
 
 =item *
 
-Add L<"index"> field as a compliment to L<"no_index">
+Add C<index> field as a compliment to L</no_index>
 
 =item *
 
-Add L<"keywords"> field as a means to aid searching distributions.
+Add L</keywords> field as a means to aid searching distributions.
 
 =item *
 
-Add L<"TERMINOLOGY"> section to explain certain terms that may be
+Add L</TERMINOLOGY> section to explain certain terms that may be
 ambiguous.
 
 =back
@@ -745,7 +722,7 @@ more like records of brainstorming.
 
 =item *
 
-Changed C<authored_by> to C<author>, since that's always been what
+Changed C<authored_by> to L</author>, since that's always been what
 it's actually called in actual F<META.yml> files.
 
 =item *
@@ -755,12 +732,12 @@ operators.
 
 =item *
 
-Noted that the C<distribution_type> field is basically meaningless,
+Noted that the L</distribution_type> field is basically meaningless,
 and shouldn't really be used.
 
 =item *
 
-Clarified C<dynamic_config> a bit.
+Clarified L</dynamic_config> a bit.
 
 =back
 
@@ -781,7 +758,7 @@ module that doesn't actually exist.
 
 =item *
 
-Added C<configure_requires>.
+Added L</configure_requires>.
 
 =back
 
index 05a18ea..3604eae 100644 (file)
@@ -3,7 +3,7 @@ use warnings;
 
 package CPAN::Meta::Merge;
 
-our $VERSION = '2.150005';
+our $VERSION = '2.150010';
 
 use Carp qw/croak/;
 use Scalar::Util qw/blessed/;
@@ -73,7 +73,7 @@ sub _uniq_map {
   return $left;
 }
 
-sub _improvize {
+sub _improvise {
   my ($left, $right, $path) = @_;
   my ($name) = reverse @{$path};
   if ($name =~ /^x_/) {
@@ -154,9 +154,9 @@ my %default = (
     homepage   => \&_identical,
     bugtracker => \&_uniq_map,
     repository => \&_uniq_map,
-    ':default' => \&_improvize,
+    ':default' => \&_improvise,
   },
-  ':default' => \&_improvize,
+  ':default' => \&_improvise,
 );
 
 sub new {
@@ -182,7 +182,8 @@ my %coderef_for = (
   set_addition => \&_set_addition,
   uniq_map     => \&_uniq_map,
   identical    => \&_identical,
-  improvize    => \&_improvize,
+  improvise    => \&_improvise,
+  improvize    => \&_improvise, # [sic] for backwards compatibility
 );
 
 sub _coerce_mapping {
@@ -250,7 +251,7 @@ CPAN::Meta::Merge - Merging CPAN Meta fragments
 
 =head1 VERSION
 
-version 2.150005
+version 2.150010
 
 =head1 SYNOPSIS
 
@@ -268,11 +269,60 @@ argument, C<version>, declaring the version of the meta-spec that must be
 used for the merge. It can optionally take an C<extra_mappings> argument
 that allows one to add additional merging functions for specific elements.
 
+The C<extra_mappings> arguments takes a hash ref with the same type of
+structure as described in L<CPAN::Meta::Spec>, except with its values as
+one of the L<defined merge strategies|/"MERGE STRATEGIES"> or a code ref
+to a merging function.
+
+  my $merger = CPAN::Meta::Merge->new(
+      default_version => '2',
+      extra_mappings => {
+          'optional_features' => \&custom_merge_function,
+          'x_custom' => 'set_addition',
+          'x_meta_meta' => {
+              name => 'identical',
+              tags => 'set_addition',
+          }
+      }
+  );
+
 =head2 merge(@fragments)
 
 Merge all C<@fragments> together. It will accept both CPAN::Meta objects and
 (possibly incomplete) hashrefs of metadata.
 
+=head1 MERGE STRATEGIES
+
+C<merge> uses various strategies to combine different elements of the CPAN::Meta objects.  The following strategies can be used with the extra_mappings argument of C<new>:
+
+=over
+
+=item identical
+
+The elements must be identical
+
+=item set_addition
+
+The union of two array refs
+
+  [ a, b ] U [ a, c]  = [ a, b, c ]
+
+=item uniq_map
+
+Key value pairs from the right hash are merged to the left hash.  Key
+collisions are only allowed if their values are the same.  This merge
+function will recurse into nested hash refs following the same merge
+rules.
+
+=item improvise
+
+This merge strategy will try to pick the appropriate predefined strategy
+based on what element type.  Array refs will try to use the
+C<set_addition> strategy,  Hash refs will try to use the C<uniq_map>
+strategy, and everything else will try the C<identical> strategy.
+
+=back
+
 =head1 AUTHORS
 
 =over 4
@@ -285,11 +335,15 @@ David Golden <dagolden@cpan.org>
 
 Ricardo Signes <rjbs@cpan.org>
 
+=item *
+
+Adam Kennedy <adamk@cpan.org>
+
 =back
 
 =head1 COPYRIGHT AND LICENSE
 
-This software is copyright (c) 2010 by David Golden and Ricardo Signes.
+This software is copyright (c) 2010 by David Golden, Ricardo Signes, Adam Kennedy and Contributors.
 
 This is free software; you can redistribute it and/or modify it under
 the same terms as the Perl 5 programming language system itself.
index 8a13eb1..d4e93fd 100644 (file)
@@ -3,7 +3,7 @@ use strict;
 use warnings;
 package CPAN::Meta::Prereqs;
 
-our $VERSION = '2.150005';
+our $VERSION = '2.150010';
 
 #pod =head1 DESCRIPTION
 #pod
@@ -45,6 +45,7 @@ use CPAN::Meta::Requirements 2.121;
 #pod
 #pod =cut
 
+# note we also accept anything matching /\Ax_/i
 sub __legal_phases { qw(configure build test runtime develop)   }
 sub __legal_types  { qw(requires recommends suggests conflicts) }
 
@@ -114,6 +115,40 @@ sub requirements_for {
   return $req;
 }
 
+#pod =method phases
+#pod
+#pod   my @phases = $prereqs->phases;
+#pod
+#pod This method returns the list of all phases currently populated in the prereqs
+#pod object, suitable for iterating.
+#pod
+#pod =cut
+
+sub phases {
+  my ($self) = @_;
+
+  my %is_legal_phase = map {; $_ => 1 } $self->__legal_phases;
+  grep { /\Ax_/i or $is_legal_phase{$_} } keys %{ $self->{prereqs} };
+}
+
+#pod =method types_in
+#pod
+#pod   my @runtime_types = $prereqs->types_in('runtime');
+#pod
+#pod This method returns the list of all types currently populated in the prereqs
+#pod object for the provided phase, suitable for iterating.
+#pod
+#pod =cut
+
+sub types_in {
+  my ($self, $phase) = @_;
+
+  return unless $phase =~ /\Ax_/i or grep { $phase eq $_ } $self->__legal_phases;
+
+  my %is_legal_type  = map {; $_ => 1 } $self->__legal_types;
+  grep { /\Ax_/i or $is_legal_type{$_} } keys %{ $self->{prereqs}{$phase} };
+}
+
 #pod =method with_merged_prereqs
 #pod
 #pod   my $new_prereqs = $prereqs->with_merged_prereqs( $other_prereqs );
@@ -139,8 +174,9 @@ sub with_merged_prereqs {
 
   my %new_arg;
 
-  for my $phase ($self->__legal_phases) {
-    for my $type ($self->__legal_types) {
+  for my $phase (__uniq(map { $_->phases } @prereq_objs)) {
+    for my $type (__uniq(map { $_->types_in($phase) } @prereq_objs)) {
+
       my $req = CPAN::Meta::Requirements->new;
 
       for my $prereq (@prereq_objs) {
@@ -215,8 +251,8 @@ sub as_string_hash {
 
   my %hash;
 
-  for my $phase ($self->__legal_phases) {
-    for my $type ($self->__legal_types) {
+  for my $phase ($self->phases) {
+    for my $type ($self->types_in($phase)) {
       my $req = $self->requirements_for($phase, $type);
       next unless $req->required_modules;
 
@@ -271,6 +307,11 @@ sub clone {
   my $clone = (ref $self)->new( $self->as_string_hash );
 }
 
+sub __uniq {
+  my (%s, $u);
+  grep { defined($_) ? !$s{$_}++ : !$u++ } @_;
+}
+
 1;
 
 # ABSTRACT: a set of distribution prerequisites by phase and type
@@ -285,7 +326,7 @@ CPAN::Meta::Prereqs - a set of distribution prerequisites by phase and type
 
 =head1 VERSION
 
-version 2.150005
+version 2.150010
 
 =head1 DESCRIPTION
 
@@ -333,6 +374,20 @@ be added to as needed.
 If C<$phase> or C<$type> are undefined or otherwise invalid, an exception will
 be raised.
 
+=head2 phases
+
+  my @phases = $prereqs->phases;
+
+This method returns the list of all phases currently populated in the prereqs
+object, suitable for iterating.
+
+=head2 types_in
+
+  my @runtime_types = $prereqs->types_in('runtime');
+
+This method returns the list of all types currently populated in the prereqs
+object for the provided phase, suitable for iterating.
+
 =head2 with_merged_prereqs
 
   my $new_prereqs = $prereqs->with_merged_prereqs( $other_prereqs );
@@ -405,11 +460,15 @@ David Golden <dagolden@cpan.org>
 
 Ricardo Signes <rjbs@cpan.org>
 
+=item *
+
+Adam Kennedy <adamk@cpan.org>
+
 =back
 
 =head1 COPYRIGHT AND LICENSE
 
-This software is copyright (c) 2010 by David Golden and Ricardo Signes.
+This software is copyright (c) 2010 by David Golden, Ricardo Signes, Adam Kennedy and Contributors.
 
 This is free software; you can redistribute it and/or modify it under
 the same terms as the Perl 5 programming language system itself.
index 9056940..16e7495 100644 (file)
@@ -8,7 +8,7 @@ use strict;
 use warnings;
 package CPAN::Meta::Spec;
 
-our $VERSION = '2.150005';
+our $VERSION = '2.150010';
 
 1;
 
@@ -29,7 +29,7 @@ CPAN::Meta::Spec - specification for CPAN distribution metadata
 
 =head1 VERSION
 
-version 2.150005
+version 2.150010
 
 =head1 SYNOPSIS
 
@@ -159,7 +159,8 @@ constraints on the values of a data element.
 =head2 Boolean
 
 A I<Boolean> is used to provide a true or false value.  It B<must> be
-represented as a defined value.
+represented as a defined value that is either "1" or "0" or stringifies
+to those values.
 
 =head2 String
 
@@ -1196,6 +1197,10 @@ L<Module::Build>
 
 L<Module::Install>
 
+=item *
+
+L<CPAN::Meta::History::Meta_1_4>
+
 =back
 
 =head1 HISTORY
@@ -1223,11 +1228,15 @@ David Golden <dagolden@cpan.org>
 
 Ricardo Signes <rjbs@cpan.org>
 
+=item *
+
+Adam Kennedy <adamk@cpan.org>
+
 =back
 
 =head1 COPYRIGHT AND LICENSE
 
-This software is copyright (c) 2010 by David Golden and Ricardo Signes.
+This software is copyright (c) 2010 by David Golden, Ricardo Signes, Adam Kennedy and Contributors.
 
 This is free software; you can redistribute it and/or modify it under
 the same terms as the Perl 5 programming language system itself.
index eddaa10..a2256de 100644 (file)
@@ -3,7 +3,7 @@ use strict;
 use warnings;
 package CPAN::Meta::Validator;
 
-our $VERSION = '2.150005';
+our $VERSION = '2.150010';
 
 #pod =head1 SYNOPSIS
 #pod
@@ -669,8 +669,8 @@ sub check_list {
 #pod
 #pod boolean($self,$key,$value)
 #pod
-#pod Validates for a boolean value. Currently these values are '1', '0', 'true',
-#pod 'false', however the latter 2 may be removed.
+#pod Validates for a boolean value: a defined value that is either "1" or "0" or
+#pod stringifies to those values.
 #pod
 #pod =item *
 #pod
@@ -833,7 +833,7 @@ sub version {
 sub boolean {
     my ($self,$key,$value) = @_;
     if(defined $value) {
-        return 1    if($value =~ /^(0|1|true|false)$/);
+        return 1    if($value =~ /^(0|1)$/);
     } else {
         $value = '<undef>';
     }
@@ -996,7 +996,7 @@ CPAN::Meta::Validator - validate CPAN distribution metadata structures
 
 =head1 VERSION
 
-version 2.150005
+version 2.150010
 
 =head1 SYNOPSIS
 
@@ -1124,8 +1124,8 @@ are both valid. A leading 'v' like 'v1.2.3' is also valid.
 
 boolean($self,$key,$value)
 
-Validates for a boolean value. Currently these values are '1', '0', 'true',
-'false', however the latter 2 may be removed.
+Validates for a boolean value: a defined value that is either "1" or "0" or
+stringifies to those values.
 
 =item *
 
@@ -1193,11 +1193,15 @@ David Golden <dagolden@cpan.org>
 
 Ricardo Signes <rjbs@cpan.org>
 
+=item *
+
+Adam Kennedy <adamk@cpan.org>
+
 =back
 
 =head1 COPYRIGHT AND LICENSE
 
-This software is copyright (c) 2010 by David Golden and Ricardo Signes.
+This software is copyright (c) 2010 by David Golden, Ricardo Signes, Adam Kennedy and Contributors.
 
 This is free software; you can redistribute it and/or modify it under
 the same terms as the Perl 5 programming language system itself.
similarity index 88%
rename from cpan/Parse-CPAN-Meta/lib/Parse/CPAN/Meta.pm
rename to cpan/CPAN-Meta/lib/Parse/CPAN/Meta.pm
index 027b1fa..688bcfe 100644 (file)
@@ -1,9 +1,10 @@
 use 5.008001;
 use strict;
+use warnings;
 package Parse::CPAN::Meta;
 # ABSTRACT: Parse META.yml and META.json CPAN metadata files
 
-our $VERSION = '1.4422';
+our $VERSION = '2.150010';
 
 use Exporter;
 use Carp 'croak';
@@ -59,7 +60,7 @@ sub load_json_string {
 }
 
 sub yaml_backend {
-  if (! defined $ENV{PERL_YAML_BACKEND} ) {
+  if ($ENV{PERL_CORE} or not defined $ENV{PERL_YAML_BACKEND} ) {
     _can_load( 'CPAN::Meta::YAML', 0.011 )
       or croak "CPAN::Meta::YAML 0.011 is not available\n";
     return "CPAN::Meta::YAML";
@@ -75,6 +76,11 @@ sub yaml_backend {
 }
 
 sub json_decoder {
+  if ($ENV{PERL_CORE}) {
+    _can_load( 'JSON::PP' => 2.27300 )
+      or croak "JSON::PP 2.27300 is not available\n";
+    return 'JSON::PP';
+  }
   if (my $decoder = $ENV{CPAN_META_JSON_DECODER}) {
     _can_load( $decoder )
       or croak "Could not load CPAN_META_JSON_DECODER '$decoder'\n";
@@ -86,6 +92,11 @@ sub json_decoder {
 }
 
 sub json_backend {
+  if ($ENV{PERL_CORE}) {
+    _can_load( 'JSON::PP' => 2.27300 )
+      or croak "JSON::PP 2.27300 is not available\n";
+    return 'JSON::PP';
+  }
   if (my $backend = $ENV{CPAN_META_JSON_BACKEND}) {
     _can_load( $backend )
       or croak "Could not load CPAN_META_JSON_BACKEND '$backend'\n";
@@ -114,7 +125,7 @@ sub _slurp {
   $content = Encode::decode('UTF-8', $content, Encode::PERLQQ());
   return $content;
 }
-  
+
 sub _can_load {
   my ($module, $version) = @_;
   (my $file = $module) =~ s{::}{/}g;
@@ -158,27 +169,27 @@ Parse::CPAN::Meta - Parse META.yml and META.json CPAN metadata files
 
 =head1 VERSION
 
-version 1.4422
+version 2.150010
 
 =head1 SYNOPSIS
 
     #############################################
     # In your file
-    
+
     ---
     name: My-Distribution
     version: 1.23
     resources:
       homepage: "http://example.com/dist/My-Distribution"
-    
-    
+
+
     #############################################
     # In your program
-    
+
     use Parse::CPAN::Meta;
-    
+
     my $distmeta = Parse::CPAN::Meta->load_file('META.yml');
-    
+
     # Reading properties
     my $name     = $distmeta->{name};
     my $version  = $distmeta->{version};
@@ -234,7 +245,7 @@ C<load_yaml_string>.
 
   my $metadata_structure = Parse::CPAN::Meta->load_json_string($json_string);
 
-This method deserializes the given string of JSON and the result.  
+This method deserializes the given string of JSON and the result.
 If the source was UTF-8 encoded, the string must be decoded before calling
 C<load_json_string>.
 
@@ -331,86 +342,27 @@ as a module to use for deserialization.  The given module must be installed,
 must load correctly and must implement the C<Load()> function or an exception
 will be thrown.
 
-=for :stopwords cpan testmatrix url annocpan anno bugtracker rt cpants kwalitee diff irc mailto metadata placeholders metacpan
-
-=head1 SUPPORT
-
-=head2 Bugs / Feature Requests
-
-Please report any bugs or feature requests through the issue tracker
-at L<https://github.com/Perl-Toolchain-Gang/Parse-CPAN-Meta/issues>.
-You will be notified automatically of any progress on your issue.
-
-=head2 Source Code
-
-This is open source software.  The code repository is available for
-public review and contribution under the terms of the license.
-
-L<https://github.com/Perl-Toolchain-Gang/Parse-CPAN-Meta>
-
-  git clone https://github.com/Perl-Toolchain-Gang/Parse-CPAN-Meta.git
-
 =head1 AUTHORS
 
 =over 4
 
 =item *
 
-Adam Kennedy <adamk@cpan.org>
-
-=item *
-
 David Golden <dagolden@cpan.org>
 
-=back
-
-=head1 CONTRIBUTORS
-
-=for stopwords Andreas Koenig David Golden Graham Knop Joshua ben Jore Karen Etheridge Matt S Trout Neil Bowers Ricardo Signes Steffen Mueller
-
-=over 4
-
-=item *
-
-Andreas Koenig <andk@cpan.org>
-
-=item *
-
-David Golden <xdg@xdg.me>
-
-=item *
-
-Graham Knop <haarg@haarg.org>
-
-=item *
-
-Joshua ben Jore <jjore@cpan.org>
-
-=item *
-
-Karen Etheridge <ether@cpan.org>
-
-=item *
-
-Matt S Trout <mst@shadowcat.co.uk>
-
-=item *
-
-Neil Bowers <neil@bowers.com>
-
 =item *
 
 Ricardo Signes <rjbs@cpan.org>
 
 =item *
 
-Steffen Mueller <smueller@cpan.org>
+Adam Kennedy <adamk@cpan.org>
 
 =back
 
 =head1 COPYRIGHT AND LICENSE
 
-This software is copyright (c) 2016 by Adam Kennedy and Contributors.
+This software is copyright (c) 2010 by David Golden, Ricardo Signes, Adam Kennedy and Contributors.
 
 This is free software; you can redistribute it and/or modify it under
 the same terms as the Perl 5 programming language system itself.
diff --git a/cpan/CPAN-Meta/t/README-data.txt b/cpan/CPAN-Meta/t/README-data.txt
new file mode 100644 (file)
index 0000000..9c665e4
--- /dev/null
@@ -0,0 +1,15 @@
+There are three test data directories:
+
+- 'data-test': These files are valid META files that test *specific*
+  conversions and are expected to have specific data in them during
+  testing. Do not put new test data here unless you are sure it meets all
+  requirements needed to pass.
+
+- 'data-valid': These files are valid META files.  Some may be improved by
+  the Converter (particularly upconverting from ancient specs).
+
+- 'data-fixable': These files are bad META files that fail validation, but
+  can be fixed via the Converter.
+
+- 'data-fail': These files are bad META files that fail validation and
+  can't be fixed.
index 7cce934..2c07423 100644 (file)
@@ -7,9 +7,12 @@ use CPAN::Meta::Validator;
 use CPAN::Meta::Converter;
 use File::Spec;
 use IO::Dir;
-use Parse::CPAN::Meta 1.4400;
+use Parse::CPAN::Meta;
 
-delete $ENV{$_} for qw/PERL_JSON_BACKEND PERL_YAML_BACKEND/; # use defaults
+delete $ENV{PERL_YAML_BACKEND};
+delete $ENV{PERL_JSON_BACKEND};
+delete $ENV{CPAN_META_JSON_BACKEND};
+delete $ENV{CPAN_META_JSON_DECODER};
 
 my @data_dirs = qw( t/data-valid t/data-fixable );
 my @files = sort map {
index dfda1ae..1c1b1df 100644 (file)
@@ -7,9 +7,12 @@ use CPAN::Meta::Validator;
 use CPAN::Meta::Converter;
 use File::Spec;
 use IO::Dir;
-use Parse::CPAN::Meta 1.4400;
+use Parse::CPAN::Meta;
 
-delete $ENV{$_} for qw/PERL_JSON_BACKEND PERL_YAML_BACKEND/; # use defaults
+delete $ENV{PERL_YAML_BACKEND};
+delete $ENV{PERL_JSON_BACKEND};
+delete $ENV{CPAN_META_JSON_BACKEND};
+delete $ENV{CPAN_META_JSON_DECODER};
 
 my $data_dir = IO::Dir->new( 't/data-fail' );
 my @files = sort grep { /^\w/ } $data_dir->read;
index a9b78de..8f8697d 100644 (file)
@@ -4,7 +4,10 @@ use Test::More 0.88;
 
 use CPAN::Meta::Converter;
 
-delete $ENV{$_} for qw/PERL_JSON_BACKEND PERL_YAML_BACKEND/; # use defaults
+delete $ENV{PERL_YAML_BACKEND};
+delete $ENV{PERL_JSON_BACKEND};
+delete $ENV{CPAN_META_JSON_BACKEND};
+delete $ENV{CPAN_META_JSON_DECODER};
 
 my $spec2 = {
     version => '2',
index 87cdbd6..9f01244 100644 (file)
@@ -9,9 +9,12 @@ use CPAN::Meta::Converter;
 use File::Spec;
 use File::Basename qw/basename/;
 use IO::Dir;
-use Parse::CPAN::Meta 1.4400;
+use Parse::CPAN::Meta;
 
-delete $ENV{$_} for qw/PERL_JSON_BACKEND PERL_YAML_BACKEND/; # use defaults
+delete $ENV{PERL_YAML_BACKEND};
+delete $ENV{PERL_JSON_BACKEND};
+delete $ENV{CPAN_META_JSON_BACKEND};
+delete $ENV{CPAN_META_JSON_DECODER};
 
 # mock file object
 package
diff --git a/cpan/CPAN-Meta/t/data-test/x_deprecated-META.json b/cpan/CPAN-Meta/t/data-test/x_deprecated-META.json
new file mode 100644 (file)
index 0000000..07a42e4
--- /dev/null
@@ -0,0 +1,148 @@
+{
+   "abstract" : "Author tests making sure correct line endings are used",
+   "author" : [
+      "Florian Ragwitz <rafl@debian.org>",
+      "Caleb Cushing <xenoterracide@gmail.com>",
+      "Karen Etheridge <ether@cpan.org>"
+   ],
+   "dynamic_config" : 0,
+   "generated_by" : "Dist::Zilla version 5.035, CPAN::Meta::Converter version 2.150002",
+   "keywords" : [
+      "plugin",
+      "test",
+      "testing",
+      "author",
+      "development",
+      "whitespace",
+      "newline",
+      "linefeed",
+      "formatting"
+   ],
+   "license" : [
+      "perl_5"
+   ],
+   "meta-spec" : {
+      "url" : "http://search.cpan.org/perldoc?CPAN::Meta::Spec",
+      "version" : 2
+   },
+   "name" : "Dist-Zilla-Plugin-Test-EOL",
+   "no_index" : {
+      "directory" : [
+         "t",
+         "xt"
+      ]
+   },
+   "prereqs" : {
+      "configure" : {
+         "requires" : {
+            "Module::Build::Tiny" : "0.039",
+            "perl" : "5.006"
+         }
+      },
+      "develop" : {
+         "recommends" : {
+            "Dist::Zilla::PluginBundle::Author::ETHER" : "0.092"
+         },
+         "requires" : {
+            "Dist::Zilla" : "5"
+         }
+      },
+      "runtime" : {
+         "requires" : {
+            "Data::Section" : "0.004",
+            "Dist::Zilla::File::InMemory" : "0",
+            "Dist::Zilla::Role::FileFinderUser" : "0",
+            "Dist::Zilla::Role::FileGatherer" : "0",
+            "Dist::Zilla::Role::FileMunger" : "0",
+            "Dist::Zilla::Role::PrereqSource" : "0",
+            "Dist::Zilla::Role::TextTemplate" : "0",
+            "Moose" : "0",
+            "Moose::Util::TypeConstraints" : "0",
+            "Path::Tiny" : "0",
+            "Sub::Exporter::ForMethods" : "0",
+            "namespace::autoclean" : "0",
+            "perl" : "5.006",
+            "strict" : "0",
+            "warnings" : "0"
+         }
+      },
+      "build" : {
+         "requires" : {
+            "Build::Requires": "1.1",
+            "Test::More" : "0"
+         }
+      },
+      "test" : {
+         "recommends" : {
+            "CPAN::Meta" : "2.120900"
+         },
+         "requires" : {
+            "Test::More" : "0.88",
+            "Test::Requires" : "1.2"
+         }
+      }
+   },
+   "provides" : {
+      "Dist::Zilla::Plugin::EOLTests" : {
+         "file" : "lib/Dist/Zilla/Plugin/EOLTests.pm",
+         "version" : "0.18",
+         "x_deprecated" : 1
+      },
+      "Dist::Zilla::Plugin::Test::EOL" : {
+         "file" : "lib/Dist/Zilla/Plugin/Test/EOL.pm",
+         "version" : "0.18"
+      }
+   },
+   "release_status" : "stable",
+   "resources" : {
+      "bugtracker" : {
+         "mailto" : "bug-Dist-Zilla-Plugin-Test-EOL@rt.cpan.org",
+         "web" : "https://rt.cpan.org/Public/Dist/Display.html?Name=Dist-Zilla-Plugin-Test-EOL"
+      },
+      "homepage" : "https://github.com/karenetheridge/Dist-Zilla-Plugin-Test-EOL",
+      "repository" : {
+         "type" : "git",
+         "url" : "https://github.com/karenetheridge/Dist-Zilla-Plugin-Test-EOL.git",
+         "web" : "https://github.com/karenetheridge/Dist-Zilla-Plugin-Test-EOL"
+      },
+      "x_IRC" : "irc://irc.perl.org/#distzilla",
+      "x_MailingList" : "http://dzil.org/#mailing-list"
+   },
+   "version" : "0.18",
+   "x_Dist_Zilla" : {
+      "perl" : {
+         "version" : "5.021010"
+      },
+      "plugins" : [
+         {
+            "class" : "Dist::Zilla::Plugin::Bootstrap::lib",
+            "config" : {
+               "Dist::Zilla::Role::Bootstrap" : {
+                  "try_built" : null
+               }
+            },
+            "name" : "Bootstrap::lib",
+            "version" : "1.001000"
+         },
+         {
+            "class" : "Dist::Zilla::Plugin::VerifyPhases",
+            "name" : "@Author::ETHER/PHASE VERIFICATION",
+            "version" : "0.010"
+         }
+      ],
+      "zilla" : {
+         "class" : "Dist::Zilla::Dist::Builder",
+         "config" : {
+            "is_trial" : ""
+         },
+         "version" : "5.035"
+      }
+   },
+   "x_authority" : "cpan:FLORA",
+   "x_authority_from_module" : "Dist::Zilla::Plugin::Test::EOL",
+   "x_contributors" : [
+      "Olivier Mengue <dolmen@cpan.org>",
+      "Shlomi Fish <shlomif@shlomifish.org>"
+   ],
+   "x_permissions_from_module" : "Dist::Zilla::Plugin::Test::EOL"
+}
diff --git a/cpan/CPAN-Meta/t/data-valid/META-1_4.yml b/cpan/CPAN-Meta/t/data-valid/META-1_4.yml
new file mode 100644 (file)
index 0000000..fa2dd8e
--- /dev/null
@@ -0,0 +1,49 @@
+---
+X_deep:
+  deep: structure
+abstract: 'Build and install Perl modules'
+author:
+  - 'Ken Williams <kwilliams@cpan.org>'
+  - 'Module-Build List <module-build@perl.org>'
+build_requires:
+  Test::More: '0'
+dynamic_config: 1
+generated_by: 'Module::Build version 0.36, CPAN::Meta::Converter version $VERSION'
+keywords:
+  - toolchain
+  - cpan
+  - dual-life
+license: perl
+meta-spec:
+  url: http://module-build.sourceforge.net/META-spec-v1.4.html
+  version: '1.4'
+name: Module-Build
+optional_features:
+  domination:
+    description: 'Take over the world'
+    requires:
+      Machine::Weather: '2.0'
+recommends:
+  Archive::Tar: '1.00'
+  ExtUtils::Install: '0.3'
+  ExtUtils::ParseXS: '2.02'
+  Pod::Text: '0'
+  YAML: '0.35'
+requires:
+  Config: '0'
+  Cwd: '0'
+  Data::Dumper: '0'
+  ExtUtils::Install: '0'
+  File::Basename: '0'
+  File::Compare: '0'
+  File::Copy: '0'
+  File::Find: '0'
+  File::Path: '0'
+  File::Spec: '0'
+  IO::File: '0'
+  perl: '5.006'
+resources:
+  license: http://dev.perl.org/licenses/
+version: '0.36'
+x_authority: cpan:FLORA
+x_serialization_backend: 'CPAN::Meta::YAML version 0.015'
diff --git a/cpan/CPAN-Meta/t/data-valid/META-2.json b/cpan/CPAN-Meta/t/data-valid/META-2.json
new file mode 100644 (file)
index 0000000..a2b6656
--- /dev/null
@@ -0,0 +1,82 @@
+{
+   "X_deep" : {
+      "deep" : "structure"
+   },
+   "abstract" : "Build and install Perl modules",
+   "author" : [
+      "Ken Williams <kwilliams@cpan.org>",
+      "Module-Build List <module-build@perl.org>"
+   ],
+   "description" : "Module::Build is a system for building, testing, and installing Perl modules.  It is meant to be an alternative to ExtUtils::MakeMaker... blah blah blah",
+   "dynamic_config" : 1,
+   "generated_by" : "Module::Build version 0.36",
+   "keywords" : [
+      "toolchain",
+      "cpan",
+      "dual-life"
+   ],
+   "license" : [
+      "perl_5"
+   ],
+   "meta-spec" : {
+      "url" : "http://search.cpan.org/perldoc?CPAN::Meta::Spec",
+      "version" : "2"
+   },
+   "name" : "Module-Build",
+   "optional_features" : {
+      "domination" : {
+         "description" : "Take over the world",
+         "prereqs" : {
+            "develop" : {
+               "requires" : {
+                  "Genius::Evil" : "1.234"
+               }
+            },
+            "runtime" : {
+               "requires" : {
+                  "Machine::Weather" : "2.0"
+               }
+            }
+         }
+      }
+   },
+   "prereqs" : {
+      "build" : {
+         "requires" : {
+            "Test::More" : "0"
+         }
+      },
+      "runtime" : {
+         "recommends" : {
+            "Archive::Tar" : "1.00",
+            "ExtUtils::Install" : "0.3",
+            "ExtUtils::ParseXS" : "2.02",
+            "Pod::Text" : "0",
+            "YAML" : "0.35"
+         },
+         "requires" : {
+            "Config" : "0",
+            "Cwd" : "0",
+            "Data::Dumper" : "0",
+            "ExtUtils::Install" : "0",
+            "File::Basename" : "0",
+            "File::Compare" : "0",
+            "File::Copy" : "0",
+            "File::Find" : "0",
+            "File::Path" : "0",
+            "File::Spec" : "0",
+            "IO::File" : "0",
+            "perl" : "5.006"
+         }
+      }
+   },
+   "release_status" : "stable",
+   "resources" : {
+      "license" : [
+         "http://dev.perl.org/licenses/"
+      ]
+   },
+   "version" : "0.36",
+   "x_authority" : "cpan:FLORA",
+   "x_serialization_backend" : "JSON::PP version 2.27300"
+}
diff --git a/cpan/CPAN-Meta/t/data-valid/x_deprecated-META.yml b/cpan/CPAN-Meta/t/data-valid/x_deprecated-META.yml
new file mode 100644 (file)
index 0000000..ac05fde
--- /dev/null
@@ -0,0 +1,91 @@
+---
+abstract: 'Author tests making sure correct line endings are used'
+author:
+  - 'Florian Ragwitz <rafl@debian.org>'
+  - 'Caleb Cushing <xenoterracide@gmail.com>'
+  - 'Karen Etheridge <ether@cpan.org>'
+build_requires:
+  Build::Requires: '1.1'
+  Test::More: '0.88'
+  Test::Requires: '1.2'
+configure_requires:
+  Module::Build::Tiny: '0.039'
+  perl: '5.006'
+dynamic_config: 0
+generated_by: 'Dist::Zilla version 5.035, CPAN::Meta::Converter version 2.150002'
+keywords:
+  - plugin
+  - test
+  - testing
+  - author
+  - development
+  - whitespace
+  - newline
+  - linefeed
+  - formatting
+license: perl
+meta-spec:
+  url: http://module-build.sourceforge.net/META-spec-v1.4.html
+  version: '1.4'
+name: Dist-Zilla-Plugin-Test-EOL
+no_index:
+  directory:
+    - t
+    - xt
+provides:
+  Dist::Zilla::Plugin::EOLTests:
+    file: lib/Dist/Zilla/Plugin/EOLTests.pm
+    version: '0.18'
+    x_deprecated: 1
+  Dist::Zilla::Plugin::Test::EOL:
+    file: lib/Dist/Zilla/Plugin/Test/EOL.pm
+    version: '0.18'
+requires:
+  Data::Section: '0.004'
+  Dist::Zilla::File::InMemory: '0'
+  Dist::Zilla::Role::FileFinderUser: '0'
+  Dist::Zilla::Role::FileGatherer: '0'
+  Dist::Zilla::Role::FileMunger: '0'
+  Dist::Zilla::Role::PrereqSource: '0'
+  Dist::Zilla::Role::TextTemplate: '0'
+  Moose: '0'
+  Moose::Util::TypeConstraints: '0'
+  Path::Tiny: '0'
+  Sub::Exporter::ForMethods: '0'
+  namespace::autoclean: '0'
+  perl: '5.006'
+  strict: '0'
+  warnings: '0'
+resources:
+  IRC: irc://irc.perl.org/#distzilla
+  MailingList: http://dzil.org/#mailing-list
+  bugtracker: https://rt.cpan.org/Public/Dist/Display.html?Name=Dist-Zilla-Plugin-Test-EOL
+  homepage: https://github.com/karenetheridge/Dist-Zilla-Plugin-Test-EOL
+  repository: https://github.com/karenetheridge/Dist-Zilla-Plugin-Test-EOL.git
+version: '0.18'
+x_Dist_Zilla:
+  perl:
+    version: '5.021010'
+  plugins:
+    -
+      class: Dist::Zilla::Plugin::Bootstrap::lib
+      config:
+        Dist::Zilla::Role::Bootstrap:
+          try_built: ~
+      name: Bootstrap::lib
+      version: '1.001000'
+    -
+      class: Dist::Zilla::Plugin::VerifyPhases
+      name: '@Author::ETHER/PHASE VERIFICATION'
+      version: '0.010'
+  zilla:
+    class: Dist::Zilla::Dist::Builder
+    config:
+      is_trial: ''
+    version: '5.035'
+x_authority: cpan:FLORA
+x_authority_from_module: Dist::Zilla::Plugin::Test::EOL
+x_contributors:
+  - 'Olivier Mengue <dolmen@cpan.org>'
+  - 'Shlomi Fish <shlomif@shlomifish.org>'
+x_permissions_from_module: Dist::Zilla::Plugin::Test::EOL
index 7cae168..f22ca3e 100644 (file)
@@ -8,7 +8,10 @@ use IO::Dir;
 
 sub _slurp { do { local(@ARGV,$/)=shift(@_); <> } }
 
-delete $ENV{$_} for qw/PERL_JSON_BACKEND PERL_YAML_BACKEND/; # use defaults
+delete $ENV{PERL_YAML_BACKEND};
+delete $ENV{PERL_JSON_BACKEND};
+delete $ENV{CPAN_META_JSON_BACKEND};
+delete $ENV{CPAN_META_JSON_DECODER};
 
 my $data_dir = IO::Dir->new( 't/data-fixable' );
 my @files = sort grep { /^\w/ } $data_dir->read;
index 39e8124..73e8c3e 100644 (file)
@@ -5,6 +5,11 @@ use Test::More;
 use CPAN::Meta;
 use CPAN::Meta::Merge;
 
+delete $ENV{PERL_YAML_BACKEND};
+delete $ENV{PERL_JSON_BACKEND};
+delete $ENV{CPAN_META_JSON_BACKEND};
+delete $ENV{CPAN_META_JSON_DECODER};
+
 my %base = (
        abstract => 'This is a test',
        author => ['A.U. Thor'],
@@ -139,7 +144,7 @@ is_deeply($merger->merge(\%base, { abstract => 'This is a test' }), \%base, 'Can
 is(
     eval { $merger->merge(\%base, { abstract => 'And now for something else' }) },
     undef,
-    'Trying to merge different author gives an exception',
+    'Trying to merge different abstract gives an exception',
 );
 like $@, qr/^Can't merge attribute abstract/, 'Exception looks right';
 
@@ -164,6 +169,55 @@ is_deeply(
        'Trying to merge a new key for provides.$module is permitted; identical values are preserved',
 );
 
+my $extra_merger = CPAN::Meta::Merge->new(
+       default_version => '2',
+       extra_mappings => {
+               'x_toolkit' => 'set_addition',
+               'x_meta_meta' => {
+                       name => 'identical',
+                       tags => 'set_addition',
+               }
+       }
+);
+
+my $extra_results = $extra_merger->merge(\%base, {
+               x_toolkit => [ 'marble' ],
+               x_meta_meta => {
+                       name => 'Test',
+                       tags => [ 'Testing' ],
+               }
+       },
+       { x_toolkit => [ 'trike'],
+               x_meta_meta => {
+                       name => 'Test',
+                       tags => [ 'TDD' ],
+               }
+       }
+);
+
+my $expected_nested_extra = {
+       name => 'Test',
+       tags => [ 'Testing', 'TDD' ],
+};
+is_deeply($extra_results->{x_toolkit}, [ 'marble', 'trike' ], 'Extra mapping fields are merged');
+is_deeply($extra_results->{x_meta_meta}, $expected_nested_extra, 'Nested extra mapping fields are merged' );
+
+my $adds_to = sub {
+  my ($left, $right, $path) = @_;
+  if ($right !~ /^\Q$left\E/) {
+    die sprintf "Can't merge attribute %s: '%s' does not start with '%s'", join('.', @{$path}), $right, $left;
+  }
+  return $right;
+};
+
+$extra_merger = CPAN::Meta::Merge->new(default_version => '2', extra_mappings => { 'abstract' => \&$adds_to } );
+my $extra_results2 = $extra_merger->merge({ abstract => 'This is a test.'}, { abstract => 'This is a test.  Includes more detail..' } );
+is($extra_results2->{abstract}, 'This is a test.  Includes more detail..', 'Extra mapping fields overwrite existing mappings');
+my $extra_failure = eval { $extra_merger->merge({ abstract => 'This is a test.'}, { abstract => 'This is a better test.' } ) };
+is($extra_failure, undef, 'Extra mapping produces a failure');
+like $@, qr/does not start with/, 'Exception looks right';
+
+
 
 # issue 67
 @base{qw/name version release_status/} = qw/Foo-Bar 0.01 testing/;
index fa3c703..57b9185 100644 (file)
@@ -3,10 +3,13 @@ use warnings;
 use Test::More 0.88;
 
 use CPAN::Meta;
-
+use Storable qw(dclone);
 use Scalar::Util qw(blessed);
 
-delete $ENV{$_} for qw/PERL_JSON_BACKEND PERL_YAML_BACKEND/; # use defaults
+delete $ENV{PERL_YAML_BACKEND};
+delete $ENV{PERL_JSON_BACKEND};
+delete $ENV{CPAN_META_JSON_BACKEND};
+delete $ENV{CPAN_META_JSON_DECODER};
 
 my $distmeta = {
   name     => 'Module-Build',
@@ -74,7 +77,7 @@ my $distmeta = {
   X_deep => { deep => 'structure' },
 };
 
-my $meta = CPAN::Meta->new($distmeta);
+my $meta = CPAN::Meta->new(dclone $distmeta);
 
 is(
   blessed($meta->as_struct),
@@ -239,5 +242,40 @@ $chk_feature->($features[0]);
 
 $chk_feature->( $meta->feature('domination') );
 
+
+sub read_file {
+  my $filename = shift;
+  open my $fh, '<', $filename;
+  local $/;
+  my $string = <$fh>;
+  $string =~ s/\$VERSION/$CPAN::Meta::VERSION/g;
+  $string;
+}
+
+sub clean_backends {
+  my $string = shift;
+  $string =~ s{"?generated_by.*}{};
+  $string =~ s{"?x_serialization_backend.*}{};
+  return $string;
+}
+
+is(
+  clean_backends($meta->as_string()),
+  clean_backends(read_file('t/data-valid/META-2.json')),
+  'as_string with no arguments defaults to version 2 and JSON',
+);
+
+is(
+  clean_backends($meta->as_string({ version => 2 })),
+  clean_backends(read_file('t/data-valid/META-2.json')),
+  'as_string using version 2 defaults to JSON',
+);
+
+is(
+  clean_backends($meta->as_string({ version => 1.4 })),
+  clean_backends(read_file('t/data-valid/META-1_4.yml')),
+  'as_string using version 1.4 defaults to YAML',
+);
+
 done_testing;
 # vim: ts=2 sts=2 sw=2 et :
index 554e921..0927ad2 100644 (file)
@@ -4,7 +4,10 @@ use Test::More 0.88;
 
 use CPAN::Meta;
 
-delete $ENV{$_} for qw/PERL_JSON_BACKEND PERL_YAML_BACKEND/; # use defaults
+delete $ENV{PERL_YAML_BACKEND};
+delete $ENV{PERL_JSON_BACKEND};
+delete $ENV{CPAN_META_JSON_BACKEND};
+delete $ENV{CPAN_META_JSON_DECODER};
 
 my %distmeta = (
   name     => 'Module-Billed',
index 76ea964..7036cdc 100644 (file)
@@ -5,6 +5,11 @@ use Test::More;
 use CPAN::Meta;
 use CPAN::Meta::Merge;
 
+delete $ENV{PERL_YAML_BACKEND};
+delete $ENV{PERL_JSON_BACKEND};
+delete $ENV{CPAN_META_JSON_BACKEND};
+delete $ENV{CPAN_META_JSON_DECODER};
+
 my %base = (
        abstract => 'This is a test',
        author => ['A.U. Thor'],
similarity index 84%
rename from cpan/Parse-CPAN-Meta/t/02_api.t
rename to cpan/CPAN-Meta/t/parse-cpan-meta/02_api.t
index 3f82fc4..c0ee52d 100644 (file)
@@ -67,7 +67,7 @@ my $json_meta = catfile( test_data_directory(), 'json.meta' );
 
 ### YAML tests
 {
-  local $ENV{PERL_YAML_BACKEND}; # ensure we get CPAN::META::YAML
+  local $ENV{PERL_YAML_BACKEND} if not $ENV{PERL_CORE}; # ensure we always get CPAN::META::YAML
 
   is(Parse::CPAN::Meta->yaml_backend(), 'CPAN::Meta::YAML', 'yaml_backend(): CPAN::Meta::YAML');
   my $from_yaml = Parse::CPAN::Meta->load_file( $meta_yaml );
@@ -75,7 +75,7 @@ my $json_meta = catfile( test_data_directory(), 'json.meta' );
 }
 
 {
-  local $ENV{PERL_YAML_BACKEND}; # ensure we get CPAN::META::YAML
+  local $ENV{PERL_YAML_BACKEND} if not $ENV{PERL_CORE}; # ensure we always get CPAN::META::YAML
 
   note '';
   is(Parse::CPAN::Meta->yaml_backend(), 'CPAN::Meta::YAML', 'yaml_backend(): CPAN::Meta::YAML');
@@ -84,7 +84,7 @@ my $json_meta = catfile( test_data_directory(), 'json.meta' );
 }
 
 {
-  local $ENV{PERL_YAML_BACKEND}; # ensure we get CPAN::META::YAML
+  local $ENV{PERL_YAML_BACKEND} if not $ENV{PERL_CORE}; # ensure we always get CPAN::META::YAML
 
   note '';
   is(Parse::CPAN::Meta->yaml_backend(), 'CPAN::Meta::YAML', 'yaml_backend(): CPAN::Meta::YAML');
@@ -93,7 +93,7 @@ my $json_meta = catfile( test_data_directory(), 'json.meta' );
 }
 
 {
-  local $ENV{PERL_YAML_BACKEND}; # ensure we get CPAN::META::YAML
+  local $ENV{PERL_YAML_BACKEND} if not $ENV{PERL_CORE}; # ensure we always get CPAN::META::YAML
 
   note '';
   is(Parse::CPAN::Meta->yaml_backend(), 'CPAN::Meta::YAML', 'yaml_backend(): CPAN::Meta::YAML');
@@ -102,7 +102,7 @@ my $json_meta = catfile( test_data_directory(), 'json.meta' );
 }
 
 {
-  local $ENV{PERL_YAML_BACKEND}; # ensure we get CPAN::META::YAML
+  local $ENV{PERL_YAML_BACKEND} if not $ENV{PERL_CORE}; # ensure we always get CPAN::META::YAML
 
   note '';
   is(Parse::CPAN::Meta->yaml_backend(), 'CPAN::Meta::YAML', 'yaml_backend(): CPAN::Meta::YAML');
@@ -112,7 +112,7 @@ my $json_meta = catfile( test_data_directory(), 'json.meta' );
 }
 
 {
-  local $ENV{PERL_YAML_BACKEND}; # ensure we get CPAN::META::YAML
+  local $ENV{PERL_YAML_BACKEND} if not $ENV{PERL_CORE}; # ensure we always get CPAN::META::YAML
 
   note '';
   is(Parse::CPAN::Meta->yaml_backend(), 'CPAN::Meta::YAML', 'yaml_backend(): CPAN::Meta::YAML');
@@ -123,6 +123,7 @@ my $json_meta = catfile( test_data_directory(), 'json.meta' );
 
 SKIP: {
   note '';
+  skip 'these tests are for cpan builds only', 2 if $ENV{PERL_CORE};
   skip "YAML module not installed", 2
     unless eval "require YAML; 1";
   local $ENV{PERL_YAML_BACKEND} = 'YAML';
@@ -136,7 +137,7 @@ SKIP: {
 ### JSON tests
 {
   # JSON tests with JSON::PP
-  local $ENV{PERL_JSON_BACKEND}; # ensure we get JSON::PP
+  local $ENV{PERL_JSON_BACKEND} if not $ENV{PERL_CORE}; # ensure we always get JSON::PP
 
   note '';
   is(Parse::CPAN::Meta->json_backend(), 'JSON::PP', 'json_backend(): JSON::PP');
@@ -146,7 +147,7 @@ SKIP: {
 
 {
   # JSON tests with JSON::PP
-  local $ENV{PERL_JSON_BACKEND}; # ensure we get JSON::PP
+  local $ENV{PERL_JSON_BACKEND} if not $ENV{PERL_CORE}; # ensure we always get JSON::PP
 
   note '';
   is(Parse::CPAN::Meta->json_backend(), 'JSON::PP', 'json_backend(): JSON::PP');
@@ -156,7 +157,7 @@ SKIP: {
 
 {
   # JSON tests with JSON::PP
-  local $ENV{PERL_JSON_BACKEND}; # ensure we get JSON::PP
+  local $ENV{PERL_JSON_BACKEND} if not $ENV{PERL_CORE}; # ensure we always get JSON::PP
 
   note '';
   is(Parse::CPAN::Meta->json_backend(), 'JSON::PP', 'json_backend(): JSON::PP');
@@ -167,7 +168,7 @@ SKIP: {
 
 {
   # JSON tests with JSON::PP, take 2
-  local $ENV{PERL_JSON_BACKEND} = 0; # request JSON::PP
+  local $ENV{PERL_JSON_BACKEND} = 0 if not $ENV{PERL_CORE}; # request JSON::PP
 
   note '';
   is(Parse::CPAN::Meta->json_backend(), 'JSON::PP', 'json_backend(): JSON::PP');
@@ -178,7 +179,7 @@ SKIP: {
 
 {
   # JSON tests with JSON::PP, take 3
-  local $ENV{PERL_JSON_BACKEND} = 'JSON::PP'; # request JSON::PP
+  local $ENV{PERL_JSON_BACKEND} = 'JSON::PP' if not $ENV{PERL_CORE}; # request JSON::PP
 
   note '';
   is(Parse::CPAN::Meta->json_backend(), 'JSON::PP', 'json_backend(): JSON::PP');
@@ -187,14 +188,17 @@ SKIP: {
   is_deeply($from_json, $want, "load_json_string with PERL_JSON_BACKEND = 'JSON::PP'");
 }
 
-{
+SKIP: {
   # JSON tests with fake backend
+
+  note '';
+  skip 'these tests are for cpan builds only', 2 if $ENV{PERL_CORE};
+
   { package MyJSONThingy; $INC{'MyJSONThingy.pm'} = __FILE__; require JSON::PP;
     sub decode_json { JSON::PP::decode_json(@_) } }
 
   local $ENV{CPAN_META_JSON_DECODER} = 'MyJSONThingy'; # request fake backend
 
-  note '';
   is(Parse::CPAN::Meta->json_decoder(), 'MyJSONThingy', 'json_decoder(): MyJSONThingy');
   my $json   = load_ok( $meta_json, $meta_json, 100, ":encoding(UTF-8)");
   my $from_json = Parse::CPAN::Meta->load_json_string( $json );
@@ -203,6 +207,7 @@ SKIP: {
 
 SKIP: {
   note '';
+  skip 'these tests are for cpan builds only', 2 if $ENV{PERL_CORE};
   skip "JSON module version 2.5 not installed", 2
     unless eval "require JSON; JSON->VERSION(2.5); 1";
   local $ENV{PERL_JSON_BACKEND} = 1;
index ac4aea8..8ace494 100644 (file)
@@ -4,7 +4,10 @@ use Test::More 0.88;
 
 use CPAN::Meta::Prereqs;
 
-delete $ENV{$_} for qw/PERL_JSON_BACKEND PERL_YAML_BACKEND/; # use defaults
+delete $ENV{PERL_YAML_BACKEND};
+delete $ENV{PERL_JSON_BACKEND};
+delete $ENV{CPAN_META_JSON_BACKEND};
+delete $ENV{CPAN_META_JSON_DECODER};
 
 sub dies_ok (&@) {
   my ($code, $qr, $comment) = @_;
index e15c9f2..4e1baf2 100644 (file)
@@ -4,7 +4,10 @@ use Test::More 0.88;
 
 use CPAN::Meta::Prereqs;
 
-delete $ENV{$_} for qw/PERL_JSON_BACKEND PERL_YAML_BACKEND/; # use defaults
+delete $ENV{PERL_YAML_BACKEND};
+delete $ENV{PERL_JSON_BACKEND};
+delete $ENV{CPAN_META_JSON_BACKEND};
+delete $ENV{CPAN_META_JSON_DECODER};
 
 my $prereq_struct_1 = {
   runtime => {
@@ -22,7 +25,15 @@ my $prereq_struct_1 = {
     requires => {
       'Test' => 0,
     },
-  }
+    x_type => {
+      'Config' => 1,
+    },
+  },
+  x_phase => {
+    x_type => {
+      'POSIX' => '1.23',
+    },
+  },
 };
 
 my $prereq_1 = CPAN::Meta::Prereqs->new($prereq_struct_1);
@@ -50,7 +61,12 @@ my $prereq_struct_2 = {
     suggests => {
       'Module::Build::Bob' => '20100101',
     },
-  }
+  },
+  x_phase => {
+    requires => {
+      'JSON::PP' => '2.34',
+    },
+  },
 };
 
 my $prereq_2 = CPAN::Meta::Prereqs->new($prereq_struct_2);
@@ -88,6 +104,17 @@ my $want = {
     suggests => {
       'Module::Build::Bob' => '20100101',
     },
+    x_type => {
+      'Config' => 1,
+    },
+  },
+  x_phase => {
+    requires => {
+      'JSON::PP' => '2.34',
+    },
+    x_type => {
+      'POSIX' => '1.23',
+    },
   },
 };
 
index b4a3c95..01ca003 100644 (file)
@@ -4,7 +4,10 @@ use Test::More 0.88;
 
 use CPAN::Meta::Prereqs;
 
-delete $ENV{$_} for qw/PERL_JSON_BACKEND PERL_YAML_BACKEND/; # use defaults
+delete $ENV{PERL_YAML_BACKEND};
+delete $ENV{PERL_JSON_BACKEND};
+delete $ENV{CPAN_META_JSON_BACKEND};
+delete $ENV{CPAN_META_JSON_DECODER};
 
 my $prereq_struct = {
   runtime => {
@@ -34,7 +37,18 @@ my $prereq_struct = {
     requires => {
       'Test' => 0,
     },
-  }
+    x_type => {
+      'Config' => 1,
+    },
+  },
+  x_phase => {
+    requires => {
+      'JSON::PP' => '2.34',
+    },
+    x_type => {
+      'POSIX' => '1.23',
+    },
+  },
 };
 
 my $prereq = CPAN::Meta::Prereqs->new($prereq_struct);
index 0cd2c24..cf18aff 100644 (file)
@@ -4,7 +4,10 @@ use Test::More 0.88;
 
 use CPAN::Meta;
 
-delete $ENV{$_} for qw/PERL_JSON_BACKEND PERL_YAML_BACKEND/; # use defaults
+delete $ENV{PERL_YAML_BACKEND};
+delete $ENV{PERL_JSON_BACKEND};
+delete $ENV{CPAN_META_JSON_BACKEND};
+delete $ENV{CPAN_META_JSON_DECODER};
 
 # 1.4 repository upgrade
 {
index 8093344..ef596f8 100644 (file)
@@ -4,9 +4,12 @@ use Test::More 0.88;
 
 use CPAN::Meta;
 use File::Temp 0.20 ();
-use Parse::CPAN::Meta 1.4400;
+use Parse::CPAN::Meta;
 
-delete $ENV{$_} for qw/PERL_JSON_BACKEND PERL_YAML_BACKEND/; # use defaults
+delete $ENV{PERL_YAML_BACKEND};
+delete $ENV{PERL_JSON_BACKEND};
+delete $ENV{CPAN_META_JSON_BACKEND};
+delete $ENV{CPAN_META_JSON_DECODER};
 
 my $distmeta = {
   name     => 'Module-Build',
index 0145073..99a00c3 100644 (file)
@@ -6,9 +6,12 @@ use CPAN::Meta;
 use CPAN::Meta::Validator;
 use File::Spec;
 use IO::Dir;
-use Parse::CPAN::Meta 1.4400;
+use Parse::CPAN::Meta;
 
-delete $ENV{$_} for qw/PERL_JSON_BACKEND PERL_YAML_BACKEND/; # use defaults
+delete $ENV{PERL_YAML_BACKEND};
+delete $ENV{PERL_JSON_BACKEND};
+delete $ENV{CPAN_META_JSON_BACKEND};
+delete $ENV{CPAN_META_JSON_DECODER};
 
 {
   my @data_dirs = qw( t/data-test t/data-valid );
diff --git a/t/TEST b/t/TEST
index b27ab02..e00029c 100755 (executable)
--- a/t/TEST
+++ b/t/TEST
@@ -51,7 +51,6 @@ my %abs = (
           '../cpan/Locale-Codes' => 1,
           '../cpan/Module-Load' => 1,
           '../cpan/Module-Load-Conditional' => 1,
-          '../cpan/Parse-CPAN-Meta' => 1,
           '../cpan/Pod-Simple' => 1,
           '../cpan/Test-Simple' => 1,
           '../cpan/podlators' => 1,
@@ -69,7 +68,6 @@ my %temp_no_core =
      '../cpan/IO-Compress' => 1,
      '../cpan/MIME-Base64' => 1,
      '../cpan/parent' => 1,
-     '../cpan/Parse-CPAN-Meta' => 1,
      '../cpan/Pod-Simple' => 1,
      '../cpan/podlators' => 1,
      '../cpan/Test-Simple' => 1,