diff options
author | Chris 'BinGOs' Williams <chris@bingosnet.co.uk> | 2014-11-20 15:55:11 +0000 |
---|---|---|
committer | Chris 'BinGOs' Williams <chris@bingosnet.co.uk> | 2014-11-20 16:03:00 +0000 |
commit | b907e848c200047115c6d9ded5c73601208ea87b (patch) | |
tree | 9fb901d4178001fd12dd03d74c85140c6c587be1 /cpan/CPAN-Meta/lib | |
parent | 1a85ea9547a3c97e1b3d2ca5790981ec60962564 (diff) | |
download | perl-b907e848c200047115c6d9ded5c73601208ea87b.tar.gz |
Update CPAN-Meta to CPAN version 2.143240
[DELTA]
2.143240 2014-11-20 10:26:30-05:00 America/New_York
[FIXED]
- Give correct path in nested merges such as resources
- Removed strings test that should have been removed when
CPAN::Meta::Requirements was removed to a separate dist
Diffstat (limited to 'cpan/CPAN-Meta/lib')
-rw-r--r-- | cpan/CPAN-Meta/lib/CPAN/Meta.pm | 16 | ||||
-rw-r--r-- | cpan/CPAN-Meta/lib/CPAN/Meta/Converter.pm | 4 | ||||
-rw-r--r-- | cpan/CPAN-Meta/lib/CPAN/Meta/Feature.pm | 4 | ||||
-rw-r--r-- | cpan/CPAN-Meta/lib/CPAN/Meta/History.pm | 4 | ||||
-rw-r--r-- | cpan/CPAN-Meta/lib/CPAN/Meta/Merge.pm | 40 | ||||
-rw-r--r-- | cpan/CPAN-Meta/lib/CPAN/Meta/Prereqs.pm | 4 | ||||
-rw-r--r-- | cpan/CPAN-Meta/lib/CPAN/Meta/Spec.pm | 4 | ||||
-rw-r--r-- | cpan/CPAN-Meta/lib/CPAN/Meta/Validator.pm | 4 |
8 files changed, 57 insertions, 23 deletions
diff --git a/cpan/CPAN-Meta/lib/CPAN/Meta.pm b/cpan/CPAN-Meta/lib/CPAN/Meta.pm index f2a8936584..83e4ced31c 100644 --- a/cpan/CPAN-Meta/lib/CPAN/Meta.pm +++ b/cpan/CPAN-Meta/lib/CPAN/Meta.pm @@ -3,7 +3,7 @@ use strict; use warnings; package CPAN::Meta; # VERSION -$CPAN::Meta::VERSION = '2.142690'; +$CPAN::Meta::VERSION = '2.143240'; #pod =head1 SYNOPSIS #pod #pod use v5.10; @@ -465,7 +465,8 @@ sub effective_prereqs { #pod #pod This method returns true if the given file should be indexed. It decides this #pod by checking the C<file> and C<directory> keys in the C<no_index> property of -#pod the distmeta structure. +#pod the distmeta structure. Note that neither the version format nor +#pod C<release_status> are considered. #pod #pod C<$filename> should be given in unix format. #pod @@ -492,7 +493,8 @@ sub should_index_file { #pod #pod This method returns true if the given package should be indexed. It decides #pod this by checking the C<package> and C<namespace> keys in the C<no_index> -#pod property of the distmeta structure. +#pod property of the distmeta structure. Note that neither the version format nor +#pod C<release_status> are considered. #pod #pod =cut @@ -641,7 +643,7 @@ CPAN::Meta - the distribution metadata for a CPAN dist =head1 VERSION -version 2.142690 +version 2.143240 =head1 SYNOPSIS @@ -799,7 +801,8 @@ distribution's core prereqs before the CPAN::Meta::Prereqs object is returned. This method returns true if the given file should be indexed. It decides this by checking the C<file> and C<directory> keys in the C<no_index> property of -the distmeta structure. +the distmeta structure. Note that neither the version format nor +C<release_status> are considered. C<$filename> should be given in unix format. @@ -809,7 +812,8 @@ C<$filename> should be given in unix format. This method returns true if the given package should be indexed. It decides this by checking the C<package> and C<namespace> keys in the C<no_index> -property of the distmeta structure. +property of the distmeta structure. Note that neither the version format nor +C<release_status> are considered. =head2 features diff --git a/cpan/CPAN-Meta/lib/CPAN/Meta/Converter.pm b/cpan/CPAN-Meta/lib/CPAN/Meta/Converter.pm index 1a92af49d5..fe89c36819 100644 --- a/cpan/CPAN-Meta/lib/CPAN/Meta/Converter.pm +++ b/cpan/CPAN-Meta/lib/CPAN/Meta/Converter.pm @@ -3,7 +3,7 @@ use strict; use warnings; package CPAN::Meta::Converter; # VERSION -$CPAN::Meta::Converter::VERSION = '2.142690'; +$CPAN::Meta::Converter::VERSION = '2.143240'; #pod =head1 SYNOPSIS #pod #pod my $struct = decode_json_file('META.json'); @@ -1494,7 +1494,7 @@ CPAN::Meta::Converter - Convert CPAN distribution metadata structures =head1 VERSION -version 2.142690 +version 2.143240 =head1 SYNOPSIS diff --git a/cpan/CPAN-Meta/lib/CPAN/Meta/Feature.pm b/cpan/CPAN-Meta/lib/CPAN/Meta/Feature.pm index 35476cf628..45ab89722c 100644 --- a/cpan/CPAN-Meta/lib/CPAN/Meta/Feature.pm +++ b/cpan/CPAN-Meta/lib/CPAN/Meta/Feature.pm @@ -3,7 +3,7 @@ use strict; use warnings; package CPAN::Meta::Feature; # VERSION -$CPAN::Meta::Feature::VERSION = '2.142690'; +$CPAN::Meta::Feature::VERSION = '2.143240'; use CPAN::Meta::Prereqs; #pod =head1 DESCRIPTION @@ -78,7 +78,7 @@ CPAN::Meta::Feature - an optional feature provided by a CPAN distribution =head1 VERSION -version 2.142690 +version 2.143240 =head1 DESCRIPTION diff --git a/cpan/CPAN-Meta/lib/CPAN/Meta/History.pm b/cpan/CPAN-Meta/lib/CPAN/Meta/History.pm index abf14f123b..b5339d138f 100644 --- a/cpan/CPAN-Meta/lib/CPAN/Meta/History.pm +++ b/cpan/CPAN-Meta/lib/CPAN/Meta/History.pm @@ -4,7 +4,7 @@ use strict; use warnings; package CPAN::Meta::History; # VERSION -$CPAN::Meta::History::VERSION = '2.142690'; +$CPAN::Meta::History::VERSION = '2.143240'; 1; # ABSTRACT: history of CPAN Meta Spec changes @@ -21,7 +21,7 @@ CPAN::Meta::History - history of CPAN Meta Spec changes =head1 VERSION -version 2.142690 +version 2.143240 =head1 DESCRIPTION diff --git a/cpan/CPAN-Meta/lib/CPAN/Meta/Merge.pm b/cpan/CPAN-Meta/lib/CPAN/Meta/Merge.pm index 490985a7d8..5571c51afc 100644 --- a/cpan/CPAN-Meta/lib/CPAN/Meta/Merge.pm +++ b/cpan/CPAN-Meta/lib/CPAN/Meta/Merge.pm @@ -3,14 +3,14 @@ use warnings; package CPAN::Meta::Merge; # VERSION -$CPAN::Meta::Merge::VERSION = '2.142690'; +$CPAN::Meta::Merge::VERSION = '2.143240'; use Carp qw/croak/; use Scalar::Util qw/blessed/; use CPAN::Meta::Converter; sub _identical { my ($left, $right, $path) = @_; - croak "Can't merge attribute " . join '.', @{$path} unless $left eq $right; + croak sprintf "Can't merge attribute %s: '%s' does not equal '%s'", join('.', @{$path}), $left, $right unless $left eq $right; return $left; } @@ -73,6 +73,36 @@ sub _improvize { croak sprintf "Can't merge '%s'", join '.', @{$path}; } +sub _optional_features { + my ($left, $right, $path) = @_; + + for my $key (keys %{$right}) { + if (not exists $left->{$key}) { + $left->{$key} = $right->{$key}; + } + else { + for my $subkey (keys %{ $right->{$key} }) { + next if $subkey eq 'prereqs'; + if (not exists $left->{$key}{$subkey}) { + $left->{$key}{$subkey} = $right->{$key}{$subkey}; + } + else { + Carp::croak "Cannot merge two optional_features named '$key' with different '$subkey' values" + if do { no warnings 'uninitialized'; $left->{$key}{$subkey} ne $right->{$key}{$subkey} }; + } + } + + require CPAN::Meta::Prereqs; + $left->{$key}{prereqs} = + CPAN::Meta::Prereqs->new($left->{$key}{prereqs}) + ->with_merged_prereqs(CPAN::Meta::Prereqs->new($right->{$key}{prereqs})) + ->as_string_hash; + } + } + return $left; +} + + my %default = ( abstract => \&_identical, author => \&_set_addition, @@ -95,7 +125,7 @@ my %default = ( description => \&_identical, keywords => \&_set_addition, no_index => { map { ($_ => \&_set_addition) } qw/file directory package namespace/ }, - optional_features => \&_uniq_map, + optional_features => \&_optional_features, prereqs => sub { require CPAN::Meta::Prereqs; my ($left, $right) = map { CPAN::Meta::Prereqs->new($_) } @_[0,1]; @@ -150,7 +180,7 @@ sub _coerce_mapping { my $mapping = _coerce_mapping($value, [ @{$map_path}, $key ]); $ret{$key} = sub { my ($left, $right, $path) = @_; - return _merge($left, $right, $mapping, [ @{$path}, $key ]); + return _merge($left, $right, $mapping, [ @{$path} ]); }; } elsif ($coderef_for{$value}) { @@ -200,7 +230,7 @@ CPAN::Meta::Merge - Merging CPAN Meta fragments =head1 VERSION -version 2.142690 +version 2.143240 =head1 SYNOPSIS diff --git a/cpan/CPAN-Meta/lib/CPAN/Meta/Prereqs.pm b/cpan/CPAN-Meta/lib/CPAN/Meta/Prereqs.pm index 3332f6b4fd..748a23752c 100644 --- a/cpan/CPAN-Meta/lib/CPAN/Meta/Prereqs.pm +++ b/cpan/CPAN-Meta/lib/CPAN/Meta/Prereqs.pm @@ -3,7 +3,7 @@ use strict; use warnings; package CPAN::Meta::Prereqs; # VERSION -$CPAN::Meta::Prereqs::VERSION = '2.142690'; +$CPAN::Meta::Prereqs::VERSION = '2.143240'; #pod =head1 DESCRIPTION #pod #pod A CPAN::Meta::Prereqs object represents the prerequisites for a CPAN @@ -286,7 +286,7 @@ CPAN::Meta::Prereqs - a set of distribution prerequisites by phase and type =head1 VERSION -version 2.142690 +version 2.143240 =head1 DESCRIPTION diff --git a/cpan/CPAN-Meta/lib/CPAN/Meta/Spec.pm b/cpan/CPAN-Meta/lib/CPAN/Meta/Spec.pm index 4a72b72851..a4e330b5f1 100644 --- a/cpan/CPAN-Meta/lib/CPAN/Meta/Spec.pm +++ b/cpan/CPAN-Meta/lib/CPAN/Meta/Spec.pm @@ -8,7 +8,7 @@ use strict; use warnings; package CPAN::Meta::Spec; # VERSION -$CPAN::Meta::Spec::VERSION = '2.142690'; +$CPAN::Meta::Spec::VERSION = '2.143240'; 1; # ABSTRACT: specification for CPAN distribution metadata @@ -28,7 +28,7 @@ CPAN::Meta::Spec - specification for CPAN distribution metadata =head1 VERSION -version 2.142690 +version 2.143240 =head1 SYNOPSIS diff --git a/cpan/CPAN-Meta/lib/CPAN/Meta/Validator.pm b/cpan/CPAN-Meta/lib/CPAN/Meta/Validator.pm index 67fb931a77..8799f527bb 100644 --- a/cpan/CPAN-Meta/lib/CPAN/Meta/Validator.pm +++ b/cpan/CPAN-Meta/lib/CPAN/Meta/Validator.pm @@ -3,7 +3,7 @@ use strict; use warnings; package CPAN::Meta::Validator; # VERSION -$CPAN::Meta::Validator::VERSION = '2.142690'; +$CPAN::Meta::Validator::VERSION = '2.143240'; #pod =head1 SYNOPSIS #pod #pod my $struct = decode_json_file('META.json'); @@ -997,7 +997,7 @@ CPAN::Meta::Validator - validate CPAN distribution metadata structures =head1 VERSION -version 2.142690 +version 2.143240 =head1 SYNOPSIS |