[SCM] Debian packaging of libperl-minimumversion-perl branch, master, updated. upstream/1.32-78-g4ec96ad
Salvatore Bonaccorso
carnil at debian.org
Wed Jan 16 22:05:43 UTC 2013
The following commit has been merged in the master branch:
commit ea9d7c0cae701071f98f0c5e9d9e6e578791602a
Author: Salvatore Bonaccorso <carnil at debian.org>
Date: Wed Jan 16 22:59:20 2013 +0100
Imported Upstream version 1.32
diff --git a/Changes b/Changes
index 3eb777b..c3da2b0 100644
--- a/Changes
+++ b/Changes
@@ -1,5 +1,10 @@
Revision history for Perl extension Perl-MinimumVersion
+1.32 Tue 16 Jan 2013
+ - require new version of PPIx::Regexp
+ - skip sub named keys/each/values in _each_argument() (Pedro Melo, RT#82718)
+ - detect open with reference to scalar (Alexandr Ciornii)
+
1.31 Tue 4 Dec 2012
- sort $subref requires perl 5.6 (Alexandr Ciornii)
diff --git a/MANIFEST b/MANIFEST
index 07dedb1..984a349 100644
--- a/MANIFEST
+++ b/MANIFEST
@@ -36,6 +36,8 @@ t/16_binmode.t
t/17_when.t
t/18_exists_subr.t
t/19_opentemp.t
+t/20_sort_subref.t
+t/21_openscalar.t
xt/meta.t
xt/pmv.t
xt/pod.t
diff --git a/META.yml b/META.yml
index 4ebbe85..bfe26cb 100644
--- a/META.yml
+++ b/META.yml
@@ -28,7 +28,7 @@ requires:
File::Find::Rule::Perl: 1.04
List::Util: 1.20
PPI: 1.215
- PPIx::Regexp: 0.028
+ PPIx::Regexp: 0.029
Params::Util: 0.25
Perl::Critic::Utils: 1.104
perl: 5.6.0
@@ -37,4 +37,4 @@ resources:
ChangeLog: http://fisheye2.atlassian.com/changelog/cpan/trunk/Perl-MinimumVersion
license: http://dev.perl.org/licenses/
repository: http://svn.ali.as/cpan/trunk/Perl-MinimumVersion
-version: 1.31
+version: 1.32
diff --git a/Makefile.PL b/Makefile.PL
index 11c5142..67a7eac 100644
--- a/Makefile.PL
+++ b/Makefile.PL
@@ -8,7 +8,7 @@ requires File::Find::Rule 0.32
requires File::Find::Rule::Perl 1.04
requires PPI 1.215
requires Perl::Critic::Utils 1.104
-requires PPIx::Regexp 0.028
+requires PPIx::Regexp 0.029
test_requires File::Spec 0.80
test_requires Test::More 0.47
test_requires Test::Script 1.03
diff --git a/README b/README
index 14ce425..c52553e 100644
--- a/README
+++ b/README
@@ -147,7 +147,7 @@ SEE ALSO
<http://ali.as/>, PPI, version
COPYRIGHT
- Copyright 2005 - 2012 Adam Kennedy.
+ Copyright 2005 - 2013 Adam Kennedy.
This program is free software; you can redistribute it and/or modify it
under the same terms as Perl itself.
diff --git a/lib/Perl/MinimumVersion.pm b/lib/Perl/MinimumVersion.pm
index f0d0dc0..6de44b0 100644
--- a/lib/Perl/MinimumVersion.pm
+++ b/lib/Perl/MinimumVersion.pm
@@ -53,7 +53,7 @@ use Perl::MinimumVersion::Reason ();
our ($VERSION, @ISA, @EXPORT_OK, %CHECKS, @CHECKS_RV ,%MATCHES);
BEGIN {
- $VERSION = '1.31';
+ $VERSION = '1.32';
# Only needed for dev releases, comment out otherwise
# $VERSION = eval $VERSION;
@@ -82,6 +82,7 @@ BEGIN {
_local_soft_reference => version->new('5.008'),
_use_carp_version => version->new('5.008'),
_open_temp => version->new('5.008'),
+ _open_scalar => version->new('5.008'),
# Included in 5.6. Broken until 5.8
_pragma_utf8 => version->new('5.008'),
@@ -633,6 +634,8 @@ sub _each_argument {
}
} elsif($next->isa('PPI::Token::Operator')) { # % $a
return '';
+ } elsif($_[1]->parent->isa('PPI::Statement::Sub')) { # sub each|keys|values
+ return '';
} else { # function call or other should be reference
if(5.014 > ($version || 0)) {
$version = 5.014;
@@ -727,6 +730,25 @@ sub _open_temp {
} );
}
+sub _open_scalar {
+ shift->Document->find_first( sub {
+ $_[1]->isa('PPI::Statement') or return '';
+ my @children = $_[1]->children;
+ #@children >= 7 or return '';
+ my $main_element = $children[0];
+ $main_element->isa('PPI::Token::Word') or return '';
+ $main_element->content eq 'open' or return '';
+ my @arguments = parse_arg_list($main_element);
+ if ( scalar @arguments == 3) {
+ my $arg3 = $arguments[2][0];
+ if ($arg3->isa('PPI::Token::Cast') and $arg3->content eq '\\') {
+ return 1;
+ }
+ }
+ return '';
+ } );
+}
+
# exists(&subr) new in 5.6.0 #
sub _exists_subr {
my ($pmv) = @_;
@@ -1299,7 +1321,7 @@ L<http://ali.as/>, L<PPI>, L<version>
=head1 COPYRIGHT
-Copyright 2005 - 2012 Adam Kennedy.
+Copyright 2005 - 2013 Adam Kennedy.
This program is free software; you can redistribute
it and/or modify it under the same terms as Perl itself.
diff --git a/lib/Perl/MinimumVersion/Reason.pm b/lib/Perl/MinimumVersion/Reason.pm
index 9fd9d85..0c5068f 100644
--- a/lib/Perl/MinimumVersion/Reason.pm
+++ b/lib/Perl/MinimumVersion/Reason.pm
@@ -10,7 +10,7 @@ use warnings;
use vars qw{$VERSION};
BEGIN {
- $VERSION = '1.31';
+ $VERSION = '1.32';
# Only needed for dev releases, comment out otherwise
# $VERSION = eval $VERSION;
diff --git a/t/14_regex.t b/t/14_regex.t
index 076a172..4e890e6 100644
--- a/t/14_regex.t
+++ b/t/14_regex.t
@@ -12,6 +12,11 @@ my %examples=(
q{s#\Ra##} => '5.009005',
q{s/\Ra//u} => '5.013010',
q{m/a/} => undef,
+ q{/(\?|I)/} => undef,
+ q{m xfoox} => undef, #unsupported by PPIx::Regexp
+ #q{/(\?>I)/} => undef,
+ #q{/(\?:I)/} => undef,
+
);
plan tests => scalar(keys %examples);
foreach my $example (sort keys %examples) {
diff --git a/t/15_each.t b/t/15_each.t
index 3edf98d..8dc78ea 100644
--- a/t/15_each.t
+++ b/t/15_each.t
@@ -29,6 +29,9 @@ my %examples=(
q{each(call())} => 5.014,
q{keys %foo} => undef,
+ q'sub keys;' => undef,
+ q'sub keys {}' => undef, # RT#82718
+ q{$obj->keys(@foo)} => undef,
q{keys @foo} => 5.012,
q{keys $ref} => 5.014,
q{keys $ref->call} => 5.014,
diff --git a/t/18_exists_subr.t b/t/20_sort_subref.t
similarity index 54%
copy from t/18_exists_subr.t
copy to t/20_sort_subref.t
index a749c30..82770d3 100644
--- a/t/18_exists_subr.t
+++ b/t/20_sort_subref.t
@@ -10,26 +10,25 @@ use Test::More;
use Perl::MinimumVersion;
my @examples_not=(
- q'exists $a{b}',
- q'exists($a{b})',
- q'exists $a{f(b)}',
- q'exists $ref->{A}->{B}',
- q'exists f->{A}->{B}',
- q'$obj->exists(&a)',
+ q'sort $coderef, @foo',
+ q'sort $coderef , @foo',
+ q'sort; $coderef, @foo',
+ q'sort {$a} @foo',
+ q'sort func $var',
);
my @examples_yes=(
- q{exists &a},
- q{exists(&a)},
- q{exists &$a},
- #q{exists & $a}, #will implement someday
- q{exists(&$a)},
- q/exists &{$ref->{A}{B}{$key}}/,
+ q'sort $coderef @foo',
+ #q'sort $$coderef @foo', #later
+ q'sort $coderef @$foo',
+ q'sort $coderef (@foo, @l)',
+ q'sort $coderef @{$foo}',
+ q'sort $coderef f($foo)',
);
plan tests =>(@examples_not+ at examples_yes);
-my $method='_exists_subr';
+my $method='_sort_subref';
foreach my $example (@examples_not) {
my $p = Perl::MinimumVersion->new(\$example);
- is( $p->$method, '', $example )
+ is( $p->$method, '', "$example - not detected")
or do { diag "\$\@: $@" if $@ };
}
foreach my $example (@examples_yes) {
diff --git a/t/18_exists_subr.t b/t/21_openscalar.t
similarity index 55%
copy from t/18_exists_subr.t
copy to t/21_openscalar.t
index a749c30..fded32a 100644
--- a/t/18_exists_subr.t
+++ b/t/21_openscalar.t
@@ -10,23 +10,20 @@ use Test::More;
use Perl::MinimumVersion;
my @examples_not=(
- q'exists $a{b}',
- q'exists($a{b})',
- q'exists $a{f(b)}',
- q'exists $ref->{A}->{B}',
- q'exists f->{A}->{B}',
- q'$obj->exists(&a)',
+ q'open(my $tmp, ">", "a") or die;',
+ q'open(my $tmp, \$scalar) or die;',
+ q'$obj->open(my $tmp, ">", \$scalar);',
+ q{open INFO, "< datafile" or print \$scalar, "can't open datafile: ",$!;},
);
my @examples_yes=(
- q{exists &a},
- q{exists(&a)},
- q{exists &$a},
- #q{exists & $a}, #will implement someday
- q{exists(&$a)},
- q/exists &{$ref->{A}{B}{$key}}/,
+ q'open(my $tmp, ">", \$scalar) or die;',
+ q'open my $tmp, ">", \$scalar or die;',
+ q'open my $tmp, ">", \$scalar;',
+ q'open my($fh), "<", \ $scalar;', #from App::Cpan
+
);
plan tests =>(@examples_not+ at examples_yes);
-my $method='_exists_subr';
+my $method='_open_scalar';
foreach my $example (@examples_not) {
my $p = Perl::MinimumVersion->new(\$example);
is( $p->$method, '', $example )
--
Debian packaging of libperl-minimumversion-perl
More information about the Pkg-perl-cvs-commits
mailing list