summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKaren Etheridge <ether@cpan.org>2016-07-29 14:55:29 -0700
committerSteve Hay <steve.m.hay@googlemail.com>2016-08-01 13:49:01 +0100
commitc1ccc6206280c3a32819220a079405239892de6c (patch)
tree42958a317a36b8a0d6291738e6d5ff114cc7d36b
parente0618bea5e233d1aeeab770e9efc1b6007fb77b6 (diff)
downloadperl-c1ccc6206280c3a32819220a079405239892de6c.tar.gz
patch Parse::CPAN::Meta to ignore PERL_YAML_BACKEND, PERL_JSON_BACKEND when PERL_CORE=1
-rwxr-xr-xPorting/Maintainers.pl2
-rw-r--r--cpan/Parse-CPAN-Meta/lib/Parse/CPAN/Meta.pm6
-rw-r--r--cpan/Parse-CPAN-Meta/t/02_api.t22
-rw-r--r--t/porting/customized.dat2
4 files changed, 19 insertions, 13 deletions
diff --git a/Porting/Maintainers.pl b/Porting/Maintainers.pl
index 27ec5e926f..bf47b400b5 100755
--- a/Porting/Maintainers.pl
+++ b/Porting/Maintainers.pl
@@ -1005,6 +1005,8 @@ use File::Glob qw(:case);
qw[t/00-report-prereqs.t],
qr{^xt},
],
+ # https://github.com/Perl-Toolchain-Gang/CPAN-Meta/pull/119
+ 'CUSTOMIZED' => [ qw[ lib/Parse/CPAN/Meta.pm t/02_api.t ] ],
},
'PathTools' => {
diff --git a/cpan/Parse-CPAN-Meta/lib/Parse/CPAN/Meta.pm b/cpan/Parse-CPAN-Meta/lib/Parse/CPAN/Meta.pm
index 77a0764772..56eecb4529 100644
--- a/cpan/Parse-CPAN-Meta/lib/Parse/CPAN/Meta.pm
+++ b/cpan/Parse-CPAN-Meta/lib/Parse/CPAN/Meta.pm
@@ -3,7 +3,7 @@ use strict;
package Parse::CPAN::Meta;
# ABSTRACT: Parse META.yml and META.json CPAN metadata files
-our $VERSION = '1.4417';
+our $VERSION = '1.4417_001';
use Exporter;
use Carp 'croak';
@@ -56,7 +56,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";
@@ -72,7 +72,7 @@ sub yaml_backend {
}
sub json_backend {
- if (! $ENV{PERL_JSON_BACKEND} or $ENV{PERL_JSON_BACKEND} eq 'JSON::PP') {
+ if ($ENV{PERL_CORE} or ! $ENV{PERL_JSON_BACKEND} or $ENV{PERL_JSON_BACKEND} eq 'JSON::PP') {
_can_load( 'JSON::PP' => 2.27103 )
or croak "JSON::PP 2.27103 is not available\n";
return 'JSON::PP';
diff --git a/cpan/Parse-CPAN-Meta/t/02_api.t b/cpan/Parse-CPAN-Meta/t/02_api.t
index 5f94bc74fa..d17fb801f7 100644
--- a/cpan/Parse-CPAN-Meta/t/02_api.t
+++ b/cpan/Parse-CPAN-Meta/t/02_api.t
@@ -58,7 +58,7 @@ my $bad_yaml_meta = catfile( test_data_directory(), 'BadMETA.yml' );
### 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 );
@@ -66,7 +66,7 @@ my $bad_yaml_meta = catfile( test_data_directory(), 'BadMETA.yml' );
}
{
- 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');
@@ -75,7 +75,7 @@ my $bad_yaml_meta = catfile( test_data_directory(), 'BadMETA.yml' );
}
{
- 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 $bad_yaml_meta = catfile( test_data_directory(), 'BadMETA.yml' );
}
{
- 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');
@@ -94,7 +94,7 @@ my $bad_yaml_meta = catfile( test_data_directory(), 'BadMETA.yml' );
}
{
- 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');
@@ -105,6 +105,7 @@ my $bad_yaml_meta = catfile( test_data_directory(), 'BadMETA.yml' );
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';
@@ -118,7 +119,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');
@@ -128,7 +129,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');
@@ -138,7 +139,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');
@@ -149,7 +150,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');
@@ -160,7 +161,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');
@@ -171,6 +172,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;
diff --git a/t/porting/customized.dat b/t/porting/customized.dat
index be5f8e777d..139acd0d50 100644
--- a/t/porting/customized.dat
+++ b/t/porting/customized.dat
@@ -97,6 +97,8 @@ JSON::PP cpan/JSON-PP/lib/JSON/PP.pm 817730a21b9be855d844e4d26023758960039e99
Locale::Maketext::Simple cpan/Locale-Maketext-Simple/lib/Locale/Maketext/Simple.pm 57ed38905791a17c150210cd6f42ead22a7707b6
Math::BigRat cpan/Math-BigRat/lib/Math/BigRat.pm 6eabc68e04f67694f6fe523e64eb013fc337ca5b
Memoize cpan/Memoize/Memoize.pm 902092ff91cdec9c7b4bd06202eb179e1ce26ca2
+Parse::CPAN::Meta cpan/Parse-CPAN-Meta/lib/Parse/CPAN/Meta.pm 2de9f411463eda2bd5f57163c12edab9a00dc598
+Parse::CPAN::Meta cpan/Parse-CPAN-Meta/t/02_api.t a692c9a7e52b08a14a954d6c405a22c0dab1cd43
Pod::Perldoc cpan/Pod-Perldoc/lib/Pod/Perldoc.pm ba3072a6af793b410b02594ed8fe109ac16a1d43
Scalar-List-Utils cpan/Scalar-List-Utils/lib/List/Util.pm 3b501b7332480b34929bc4df5d48581df3307267
Scalar-List-Utils cpan/Scalar-List-Utils/lib/List/Util/XS.pm ebd169113d3df79d31ad5535dbd7a538a8c14fd2