summaryrefslogtreecommitdiff
path: root/cpan/Module-Metadata
diff options
context:
space:
mode:
authorSteve Hay <steve.m.hay@googlemail.com>2013-09-11 09:34:33 +0100
committerSteve Hay <steve.m.hay@googlemail.com>2013-09-11 09:38:23 +0100
commitbff978faaae3c8c03edc7cf579be6660fdc89fb3 (patch)
tree3f611828f7155b3032038fdc6498a197a66e5667 /cpan/Module-Metadata
parent054559e9ad19b1a90ee0cac7d5106e5e0a809fb7 (diff)
downloadperl-bff978faaae3c8c03edc7cf579be6660fdc89fb3.tar.gz
Upgrade Module::Metadata from version 1.000016 to 1.000017
Diffstat (limited to 'cpan/Module-Metadata')
-rw-r--r--cpan/Module-Metadata/lib/Module/Metadata.pm9
-rw-r--r--cpan/Module-Metadata/t/encoding.t1
-rw-r--r--cpan/Module-Metadata/t/lib/DistGen.pm4
-rw-r--r--cpan/Module-Metadata/t/lib/MBTest.pm1
-rw-r--r--cpan/Module-Metadata/t/lib/Tie/CPHash.pm1
-rw-r--r--cpan/Module-Metadata/t/metadata.t1
-rw-r--r--cpan/Module-Metadata/t/taint.t20
-rw-r--r--cpan/Module-Metadata/t/version.t1
8 files changed, 35 insertions, 3 deletions
diff --git a/cpan/Module-Metadata/lib/Module/Metadata.pm b/cpan/Module-Metadata/lib/Module/Metadata.pm
index a9a81ef641..c7bcb43467 100644
--- a/cpan/Module-Metadata/lib/Module/Metadata.pm
+++ b/cpan/Module-Metadata/lib/Module/Metadata.pm
@@ -10,8 +10,9 @@ package Module::Metadata;
# parrot future to look at other types of modules).
use strict;
-use vars qw($VERSION);
-$VERSION = '1.000016';
+use warnings;
+
+our $VERSION = '1.000017';
$VERSION = eval $VERSION;
use Carp qw/croak/;
@@ -649,7 +650,7 @@ sub _evaluate_version_line {
# compiletime/runtime issues with local()
my $vsub;
$pn++; # everybody gets their own package
- my $eval = qq{BEGIN { q# Hide from _packages_inside()
+ my $eval = qq{BEGIN { my \$dummy = q# Hide from _packages_inside()
#; package Module::Metadata::_version::p$pn;
use version;
no strict;
@@ -662,6 +663,8 @@ sub _evaluate_version_line {
};
}};
+ $eval = $1 if $eval =~ m{^(.+)}s;
+
local $^W;
# Try to get the $VERSION
eval $eval;
diff --git a/cpan/Module-Metadata/t/encoding.t b/cpan/Module-Metadata/t/encoding.t
index a0970e051c..b010f7e727 100644
--- a/cpan/Module-Metadata/t/encoding.t
+++ b/cpan/Module-Metadata/t/encoding.t
@@ -1,6 +1,7 @@
#!perl
use strict;
+use warnings;
use File::Spec;
use Test::More;
diff --git a/cpan/Module-Metadata/t/lib/DistGen.pm b/cpan/Module-Metadata/t/lib/DistGen.pm
index 9fbd6d0c8c..2353120e99 100644
--- a/cpan/Module-Metadata/t/lib/DistGen.pm
+++ b/cpan/Module-Metadata/t/lib/DistGen.pm
@@ -1,6 +1,7 @@
package DistGen;
use strict;
+use warnings;
use vars qw( $VERSION $VERBOSE @EXPORT_OK);
@@ -182,6 +183,7 @@ sub _gen_default_filedata {
\$VERSION = '0.01';
use strict;
+ use warnings;
1;
@@ -205,6 +207,7 @@ sub _gen_default_filedata {
$self->$add_unless('t/basic.t', undent(<<" ---"));
use Test::More tests => 1;
use strict;
+ use warnings;
use $self->{name};
ok 1;
@@ -470,6 +473,7 @@ sub change_build_pl {
$self->change_file( 'Build.PL', undent(<<" ---") );
use strict;
+ use warnings;
use Module::Build;
my \$b = Module::Build->new(
# Some CPANPLUS::Dist::Build versions need to allow mismatches
diff --git a/cpan/Module-Metadata/t/lib/MBTest.pm b/cpan/Module-Metadata/t/lib/MBTest.pm
index 005920fd8c..fb239abf48 100644
--- a/cpan/Module-Metadata/t/lib/MBTest.pm
+++ b/cpan/Module-Metadata/t/lib/MBTest.pm
@@ -1,6 +1,7 @@
package MBTest;
use strict;
+use warnings;
use IO::File ();
use File::Spec;
diff --git a/cpan/Module-Metadata/t/lib/Tie/CPHash.pm b/cpan/Module-Metadata/t/lib/Tie/CPHash.pm
index b1676221cc..217d642576 100644
--- a/cpan/Module-Metadata/t/lib/Tie/CPHash.pm
+++ b/cpan/Module-Metadata/t/lib/Tie/CPHash.pm
@@ -20,6 +20,7 @@ package Tie::CPHash;
require 5.000;
use strict;
+use warnings;
use vars qw(@ISA $VERSION);
@ISA = qw();
diff --git a/cpan/Module-Metadata/t/metadata.t b/cpan/Module-Metadata/t/metadata.t
index 286b1aeaa0..20e644035f 100644
--- a/cpan/Module-Metadata/t/metadata.t
+++ b/cpan/Module-Metadata/t/metadata.t
@@ -3,6 +3,7 @@
# vim:ts=8:sw=2:et:sta:sts=2
use strict;
+use warnings;
use lib 't/lib';
use IO::File;
use MBTest;
diff --git a/cpan/Module-Metadata/t/taint.t b/cpan/Module-Metadata/t/taint.t
new file mode 100644
index 0000000000..8ca13461f3
--- /dev/null
+++ b/cpan/Module-Metadata/t/taint.t
@@ -0,0 +1,20 @@
+#!/usr/bin/perl -T
+use strict;
+use warnings;
+
+use 5.008000; # for ${^TAINT}
+use Module::Metadata;
+use Test::More;
+use Test::Fatal;
+
+ok(${^TAINT}, 'taint flag is set');
+
+# without the fix, we get:
+# Insecure dependency in eval while running with -T switch at lib/Module/Metadata.pm line 668, <GEN0> line 15.
+is(
+ exception { Module::Metadata->new_from_module( "Module::Metadata" )->version },
+ undef,
+ 'no exception',
+);
+
+done_testing;
diff --git a/cpan/Module-Metadata/t/version.t b/cpan/Module-Metadata/t/version.t
index 061a063177..e523f97a0f 100644
--- a/cpan/Module-Metadata/t/version.t
+++ b/cpan/Module-Metadata/t/version.t
@@ -1,4 +1,5 @@
use strict;
+use warnings;
use Test::More;
use Module::Metadata;
use lib "t/lib/0_2";