cpan/CPAN-Meta/t/data-fail/META-1_3.yml
cpan/CPAN-Meta/t/data-fail/META-1_4.yml
cpan/CPAN-Meta/t/data-fail/META-2.json
+cpan/CPAN-Meta/t/data/gpl-1_4.yml
cpan/CPAN-Meta/t/data/META-1_0.yml
cpan/CPAN-Meta/t/data/META-1_1.yml
cpan/CPAN-Meta/t/data/META-1_2.yml
'CPAN::Meta' =>
{
'MAINTAINER' => 'dagolden',
- 'DISTRIBUTION' => 'DAGOLDEN/CPAN-Meta-2.110440.tar.gz',
+ 'DISTRIBUTION' => 'DAGOLDEN/CPAN-Meta-2.110930.tar.gz',
'FILES' => q[cpan/CPAN-Meta],
'EXCLUDED' => [
qr/^xt/,
Revision history for CPAN-Meta
+2.110930 2011-04-02 23:31:24 America/New_York
+
+ [BUGFIX]
+
+ - Fixed a bug in the 'as_string' method that checked the module version
+ instead of the meta-spec version when conversion was requested
+ (RT #67188)
+
+2.110910 2011-04-01 08:55:30 America/New_York
+
+ [ENHANCEMENTS]
+
+ - The 1.x spec "gpl" and "lgpl" and "mozilla" license values now up-convert
+ to "open_source" because they indicate too non-specific a license.
+
+2.110580 2011-02-27 07:58:06 EST5EDT
+
+ [OTHER]
+
+ - Add explicit dependencies on JSON::PP and CPAN::Meta::YAML instead
+ of relying on Parse::CPAN::Meta to provide them (as some CPAN Testers
+ have had P::C::M installed without them somehow)
+
+ - Removed dependency on Storable as it was not a core module
+ until Perl 5.8
+
+2.110550 2011-02-24 07:17:57 EST5EDT
+
+ [OTHER]
+
+ - Added required field 'release_status' to the synopsis of
+ CPAN::Meta::Spec (RT#66118) [Oliver Mengué]
+
+2.110540 2011-02-23 15:21:16 EST5EDT
+
+ [BUGFIX]
+
+ - Had two different Parse::CPAN::Meta requirements, one in 'requires' and
+ the other in 'build_requires'. This confused some installers, so we
+ only inlude the 'requires' now.
+
2.110440 2011-02-12 22:55:28 EST5EDT
[BUGFIX]
use warnings;
package CPAN::Meta;
BEGIN {
- $CPAN::Meta::VERSION = '2.110440';
+ $CPAN::Meta::VERSION = '2.110930';
}
# ABSTRACT: the distribution metadata for a CPAN dist
use CPAN::Meta::Prereqs;
use CPAN::Meta::Converter;
use CPAN::Meta::Validator;
-use Parse::CPAN::Meta 1.44 ();
+use Parse::CPAN::Meta 1.4400 ();
+
+sub _dclone {
+ my $ref = shift;
+ my $backend = Parse::CPAN::Meta->json_backend();
+ return $backend->new->decode(
+ $backend->new->convert_blessed->encode($ref)
+ );
+}
BEGIN {
my $value = $_[0]{ $attr };
croak "$attr must be called in list context"
unless wantarray;
- return @{ Storable::dclone($value) } if ref $value;
+ return @{ _dclone($value) } if ref $value;
return $value;
};
}
(my $subname = $attr) =~ s/-/_/;
*$subname = sub {
my $value = $_[0]{ $attr };
- return Storable::dclone($value) if $value;
+ return _dclone($value) if $value;
return {};
};
}
sub custom {
my ($self, $attr) = @_;
my $value = $self->{$attr};
- return Storable::dclone($value) if ref $value;
+ return _dclone($value) if ref $value;
return $value;
}
}
-# XXX Do we need this if we always upconvert? -- dagolden, 2010-04-14
sub meta_spec_version {
my ($self) = @_;
return $self->meta_spec->{version};
sub as_struct {
my ($self, $options) = @_;
- my $backend = Parse::CPAN::Meta->json_backend();
- my $struct = $backend->new->decode(
- $backend->new->convert_blessed->encode($self)
- );
+ my $struct = _dclone($self);
if ( $options->{version} ) {
my $cmc = CPAN::Meta::Converter->new( $struct );
$struct = $cmc->convert( version => $options->{version} );
my $version = $options->{version} || '2';
my $struct;
- if ( $self->version ne $version ) {
+ if ( $self->meta_spec_version ne $version ) {
my $cmc = CPAN::Meta::Converter->new( $self->as_struct );
$struct = $cmc->convert( version => $version );
}
=head1 VERSION
-version 2.110440
+version 2.110930
=head1 SYNOPSIS
use warnings;
package CPAN::Meta::Converter;
BEGIN {
- $CPAN::Meta::Converter::VERSION = '2.110440';
+ $CPAN::Meta::Converter::VERSION = '2.110930';
}
# ABSTRACT: Convert CPAN distribution metadata structures
use CPAN::Meta::Validator;
-use Storable qw/dclone/;
use version 0.82 ();
+use Parse::CPAN::Meta 1.4400 ();
+
+sub _dclone {
+ my $ref = shift;
+ my $backend = Parse::CPAN::Meta->json_backend();
+ return $backend->new->decode(
+ $backend->new->convert_blessed->encode($ref)
+ );
+}
my %known_specs = (
'2' => 'http://search.cpan.org/perldoc?CPAN::Meta::Spec',
unknown
);
+# The "old" values were defined by Module::Build, and were often vague. I have
+# made the decisions below based on reading Module::Build::API and how clearly
+# it specifies the version of the license.
my %license_map_2 = (
- ( map { $_ => $_ } @valid_licenses_2 ),
- apache => 'apache_2_0',
- artistic => 'artistic_1',
- artistic2 => 'artistic_2',
- gpl => 'gpl_1',
- lgpl => 'lgpl_2_1',
- mozilla => 'mozilla_1_0',
- perl => 'perl_5',
+ (map { $_ => $_ } @valid_licenses_2),
+ apache => 'apache_2_0', # clearly stated as 2.0
+ artistic => 'artistic_1', # clearly stated as 1
+ artistic2 => 'artistic_2', # clearly stated as 2
+ gpl => 'open_source', # we don't know which GPL; punt
+ lgpl => 'open_source', # we don't know which LGPL; punt
+ mozilla => 'open_source', # we don't know which MPL; punt
+ perl => 'perl_5', # clearly Perl 5
restrictive => 'restricted',
);
my $new_version = $args->{version} || $HIGHEST;
my ($old_version) = $self->{spec};
- my $converted = dclone $self->{data};
+ my $converted = _dclone($self->{data});
if ( $old_version == $new_version ) {
$converted = _convert( $converted, $cleanup{$old_version}, $old_version );
=head1 VERSION
-version 2.110440
+version 2.110930
=head1 SYNOPSIS
use warnings;
package CPAN::Meta::Feature;
BEGIN {
- $CPAN::Meta::Feature::VERSION = '2.110440';
+ $CPAN::Meta::Feature::VERSION = '2.110930';
}
# ABSTRACT: an optional feature provided by a CPAN distribution
=head1 VERSION
-version 2.110440
+version 2.110930
=head1 DESCRIPTION
use warnings;
package CPAN::Meta::History;
BEGIN {
- $CPAN::Meta::History::VERSION = '2.110440';
+ $CPAN::Meta::History::VERSION = '2.110930';
}
# ABSTRACT: history of CPAN Meta Spec changes
1;
=head1 VERSION
-version 2.110440
+version 2.110930
=head1 DESCRIPTION
use warnings;
package CPAN::Meta::Prereqs;
BEGIN {
- $CPAN::Meta::Prereqs::VERSION = '2.110440';
+ $CPAN::Meta::Prereqs::VERSION = '2.110930';
}
# ABSTRACT: a set of distribution prerequisites by phase and type
=head1 VERSION
-version 2.110440
+version 2.110930
=head1 DESCRIPTION
use warnings;
package CPAN::Meta::Spec;
BEGIN {
- $CPAN::Meta::Spec::VERSION = '2.110440';
+ $CPAN::Meta::Spec::VERSION = '2.110930';
}
# ABSTRACT: specification for CPAN distribution metadata
1;
=head1 VERSION
-version 2.110440
+version 2.110930
=head1 SYNOPSIS
. "building, testing, and installing Perl modules. "
. "It is meant to ... blah blah blah ...",
version => '0.36',
+ release_status => 'stable',
author => [
'Ken Williams <kwilliams@cpan.org>',
'Module-Build List <module-build@perl.org>', # additional contact
use warnings;
package CPAN::Meta::Validator;
BEGIN {
- $CPAN::Meta::Validator::VERSION = '2.110440';
+ $CPAN::Meta::Validator::VERSION = '2.110930';
}
# ABSTRACT: validate CPAN distribution metadata structures
=head1 VERSION
-version 2.110440
+version 2.110930
=head1 SYNOPSIS
my $original = Parse::CPAN::Meta->load_file( $path );
ok( $original, "loaded META-2.json" );
my $cmc = CPAN::Meta::Converter->new( $original );
- my $up_converted = $cmc->convert( version => 1.4 );
- ok ( $up_converted->{x_whatever},
+ my $down_converted = $cmc->convert( version => 1.4 );
+ ok ( $down_converted->{x_whatever},
"down converted 'x_' as 'x_'"
);
}
+# specific test for generalization of unclear licenses
+{
+ my $path = File::Spec->catfile('t','data','gpl-1_4.yml');
+ my $original = Parse::CPAN::Meta->load_file( $path );
+ ok( $original, "loaded gpl-1_4.yml" );
+ my $cmc = CPAN::Meta::Converter->new( $original );
+ my $up_converted = $cmc->convert( version => 2 );
+ is_deeply ( $up_converted->{license},
+ [ "open_source" ],
+ "up converted 'gpl' to 'open_source'"
+ );
+}
+
# specific test for upconverting resources
{
my $path = File::Spec->catfile('t','data','resources.yml');
--- /dev/null
+---
+abstract: 'Build and install Perl modules'
+author:
+ - 'Ken Williams <kwilliams@cpan.org>'
+ - "Development questions, bug reports, and patches should be sent to the\nModule-Build mailing list at <module-build@perl.org>."
+build_requires:
+ File::Temp: 0.15
+ Test::Harness: 3.16
+ Test::More: 0.49
+generated_by: 'Module::Build version 0.3608'
+license: gpl
+meta-spec:
+ url: http://module-build.sourceforge.net/META-spec-v1.4.html
+ version: 1.4
+name: Module-Build
+resources:
+ MailingList: mailto:module-build@perl.org
+ license: http://dev.perl.org/licenses/
+ repository: http://github.com/dagolden/module-build/
+version: 3