r47893 - in /trunk/libperl-minimumversion-perl: Changes MANIFEST META.yml Makefile.PL debian/changelog debian/control lib/Perl/MinimumVersion.pm t/03_open_3arg.t t/04_substr.t t/07_splice.t t/08_mkdir.t

jawnsy-guest at users.alioth.debian.org jawnsy-guest at users.alioth.debian.org
Sun Nov 29 06:15:03 UTC 2009


Author: jawnsy-guest
Date: Sun Nov 29 06:13:55 2009
New Revision: 47893

URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=47893
Log:
New upstream release

Added:
    trunk/libperl-minimumversion-perl/t/07_splice.t
      - copied unchanged from r47887, branches/upstream/libperl-minimumversion-perl/current/t/07_splice.t
    trunk/libperl-minimumversion-perl/t/08_mkdir.t
      - copied unchanged from r47887, branches/upstream/libperl-minimumversion-perl/current/t/08_mkdir.t
Modified:
    trunk/libperl-minimumversion-perl/Changes
    trunk/libperl-minimumversion-perl/MANIFEST
    trunk/libperl-minimumversion-perl/META.yml
    trunk/libperl-minimumversion-perl/Makefile.PL
    trunk/libperl-minimumversion-perl/debian/changelog
    trunk/libperl-minimumversion-perl/debian/control
    trunk/libperl-minimumversion-perl/lib/Perl/MinimumVersion.pm
    trunk/libperl-minimumversion-perl/t/03_open_3arg.t
    trunk/libperl-minimumversion-perl/t/04_substr.t

Modified: trunk/libperl-minimumversion-perl/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libperl-minimumversion-perl/Changes?rev=47893&op=diff
==============================================================================
--- trunk/libperl-minimumversion-perl/Changes (original)
+++ trunk/libperl-minimumversion-perl/Changes Sun Nov 29 06:13:55 2009
@@ -1,10 +1,15 @@
 Revision history for Perl extension Perl-MinimumVersion
+
+1.22 Wed  25 Nov 2009
+        - Negative length in 'splice' requires perl 5.5 (Alexandr Ciornii)
+        - 'mkdir' with one argument requires perl 5.6 (Alexandr Ciornii)
+        - 'substr' will not be checked if it is a method name (Alexandr Ciornii)
+        - better tests and fix for 3-arg 'open' (Alexandr Ciornii)
 
 1.21 Tue  24 Nov 2009
         - Add 'bytes' to 5.6 pragma (Alexandr Ciornii)
         - Add support for "version numbers" like "v1.1.1" (Alexandr Ciornii)
-        - Steal argument counting code from Perl::Critic,
-          reimplement _three_argument_open, more tests (Alexandr Ciornii)
+        - Reimplement _three_argument_open, more tests (Alexandr Ciornii)
           Now check for 3-arg open is working.
         - Check 4-arg substr that requires perl 5.5 (Alexandr Ciornii)
         - Postfix foreach requires perl 5.004.05 (Alexandr Ciornii)

Modified: trunk/libperl-minimumversion-perl/MANIFEST
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libperl-minimumversion-perl/MANIFEST?rev=47893&op=diff
==============================================================================
--- trunk/libperl-minimumversion-perl/MANIFEST (original)
+++ trunk/libperl-minimumversion-perl/MANIFEST Sun Nov 29 06:13:55 2009
@@ -22,6 +22,8 @@
 t/04_substr.t
 t/05_foreach.t
 t/06_weaken.t
+t/07_splice.t
+t/08_mkdir.t
 t/97_meta.t
 t/98_pod.t
 t/99_pmv.t

Modified: trunk/libperl-minimumversion-perl/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libperl-minimumversion-perl/META.yml?rev=47893&op=diff
==============================================================================
--- trunk/libperl-minimumversion-perl/META.yml (original)
+++ trunk/libperl-minimumversion-perl/META.yml Sun Nov 29 06:13:55 2009
@@ -25,7 +25,7 @@
   File::Find::Rule: 0.30
   File::Find::Rule::Perl: 1.04
   List::Util: 1.18
-  PPI: 1.201
+  PPI: 1.205
   Params::Util: 0.25
   Perl::Critic::Utils: 1.104
   perl: 5.005
@@ -34,4 +34,4 @@
   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.21
+version: 1.22

Modified: trunk/libperl-minimumversion-perl/Makefile.PL
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libperl-minimumversion-perl/Makefile.PL?rev=47893&op=diff
==============================================================================
--- trunk/libperl-minimumversion-perl/Makefile.PL (original)
+++ trunk/libperl-minimumversion-perl/Makefile.PL Sun Nov 29 06:13:55 2009
@@ -9,7 +9,7 @@
 requires       'Params::Util'           => '0.25';
 requires       'File::Find::Rule'       => '0.30';
 requires       'File::Find::Rule::Perl' => '1.04';
-requires       'PPI'                    => '1.201';
+requires       'PPI'                    => '1.205';
 requires       'Perl::Critic::Utils'    => '1.104';
 test_requires  'File::Spec'             => '0.80';
 test_requires  'Test::More'             => '0.47';

Modified: trunk/libperl-minimumversion-perl/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libperl-minimumversion-perl/debian/changelog?rev=47893&op=diff
==============================================================================
--- trunk/libperl-minimumversion-perl/debian/changelog (original)
+++ trunk/libperl-minimumversion-perl/debian/changelog Sun Nov 29 06:13:55 2009
@@ -1,3 +1,9 @@
+libperl-minimumversion-perl (1.22-1) UNRELEASED; urgency=low
+
+  * New upstream release
+
+ -- Jonathan Yu <jawnsy at cpan.org>  Sat, 28 Nov 2009 14:49:49 -0500
+
 libperl-minimumversion-perl (1.21-1) unstable; urgency=low
 
   [ Nathan Handler ]

Modified: trunk/libperl-minimumversion-perl/debian/control
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libperl-minimumversion-perl/debian/control?rev=47893&op=diff
==============================================================================
--- trunk/libperl-minimumversion-perl/debian/control (original)
+++ trunk/libperl-minimumversion-perl/debian/control Sun Nov 29 06:13:55 2009
@@ -2,16 +2,16 @@
 Section: perl
 Priority: optional
 Build-Depends: debhelper (>= 7)
-Build-Depends-Indep: perl,
- libppi-perl (>= 1.201), libfile-find-rule-perl, libparams-util-perl (>= 0.25),
- libfile-find-rule-perl-perl (>= 1.04),
+Build-Depends-Indep: perl, libppi-perl (>= 1.205), libfile-find-rule-perl,
+ libparams-util-perl (>= 0.25), libfile-find-rule-perl-perl (>= 1.04),
  libtest-script-perl (>= 1.03), libtest-pod-perl, libtest-cpan-meta-perl,
  perl (>= 5.10.1) | libpod-simple-perl (>= 3.07), libtest-minimumversion-perl,
- perl (>= 5.10.0) | libversion-perl (>=0.74),
+ perl (>= 5.10) | libversion-perl (>= 0.74),
  libperl-critic-perl (>= 1.104)
 Maintainer: Debian Perl Group <pkg-perl-maintainers at lists.alioth.debian.org>
 Uploaders: Vincent Danjean <vdanjean at debian.org>,
- Ansgar Burchardt <ansgar at 43-1.org>, Damyan Ivanov <dmn at debian.org>
+ Ansgar Burchardt <ansgar at 43-1.org>, Damyan Ivanov <dmn at debian.org>,
+ Jonathan Yu <jawnsy at cpan.org>
 Standards-Version: 3.8.3
 Homepage: http://search.cpan.org/dist/Perl-MinimumVersion/
 Vcs-Svn: svn://svn.debian.org/pkg-perl/trunk/libperl-minimumversion-perl/
@@ -19,15 +19,14 @@
 
 Package: libperl-minimumversion-perl
 Architecture: all
-Depends: perl, ${misc:Depends}, libppi-perl (>= 1.201),
- libfile-find-rule-perl, libfile-find-rule-perl-perl,
- libparams-util-perl (>= 0.25),
- perl (>= 5.10.0) | libversion-perl (>=0.74),
+Depends: ${perl:Depends}, ${misc:Depends}, libppi-perl (>= 1.205),
+ perl (>= 5.10) | libversion-perl (>= 0.74), libfile-find-rule-perl,
+ libfile-find-rule-perl-perl, libparams-util-perl (>= 0.25),
  libperl-critic-perl (>= 1.104)
-Description: find a minimum required version of perl for Perl code
- Perl::MinimumVersion takes Perl source code and calculates the minimum
- version of perl required to be able to run it. Because it is based on
- PPI, it can do this without having to actually load the code.
+Description: module to determine minimum required version of perl required
+ Perl::MinimumVersion is a module that inspects arbitrary Perl source code and
+ determines the minimum version of perl required to be able to run it. Because
+ it is based on PPI, it can do this without having to actually load the code.
  .
  Currently it tests both the syntax of your code, and the use of explicit
  version dependencies such as "require 5.005".

Modified: trunk/libperl-minimumversion-perl/lib/Perl/MinimumVersion.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libperl-minimumversion-perl/lib/Perl/MinimumVersion.pm?rev=47893&op=diff
==============================================================================
--- trunk/libperl-minimumversion-perl/lib/Perl/MinimumVersion.pm (original)
+++ trunk/libperl-minimumversion-perl/lib/Perl/MinimumVersion.pm Sun Nov 29 06:13:55 2009
@@ -47,7 +47,7 @@
 
 use vars qw{$VERSION @ISA @EXPORT_OK %CHECKS %MATCHES};
 BEGIN {
-	$VERSION = '1.21';
+	$VERSION = '1.22';
 
 	# Export the PMV convenience constant
 	@ISA       = 'Exporter';
@@ -80,6 +80,7 @@
 		_any_CHECK_blocks     => version->new('5.006'),
 		_three_argument_open  => version->new('5.006'),
 		_weaken               => version->new('5.006'),
+		_mkdir_1_arg          => version->new('5.006'),
 
 		_any_qr_tokens        => version->new('5.005.03'),
 		_perl_5005_pragmas    => version->new('5.005'),
@@ -88,6 +89,7 @@
 		_any_quotelike_regexp => version->new('5.005'),
 		_any_INIT_blocks      => version->new('5.005'),
 		_substr_4_arg         => version->new('5.005'),
+		_splice_negative_length => version->new('5.005'),
 
 		_postfix_foreach      => version->new('5.004.05'),
 	);
@@ -685,7 +687,7 @@
 	shift->Document->find_any( sub {
 		$_[1]->isa('PPI::Statement')  or return '';
 		my @children=$_[1]->children;
-		@children >= 7                or return '';
+		#@children >= 7                or return '';
 		my $main_element=$children[0];
 		$main_element->isa('PPI::Token::Word') or return '';
 		$main_element->content eq 'open'       or return '';
@@ -704,12 +706,66 @@
 		my $main_element=$_[1];
 		$main_element->isa('PPI::Token::Word') or return '';
 		$main_element->content eq 'substr'       or return '';
+		return '' if is_hash_key($main_element);
+		return '' if is_method_call($main_element);
+		return '' if is_subroutine_name($main_element);
+		return '' if is_included_module_name($main_element);
+		return '' if is_package_declaration($main_element);
 		my @arguments = parse_arg_list($main_element);
 		if ( scalar @arguments > 3 ) {
 			return 1;
 		}
 		return '';
 	} );
+}
+
+sub _mkdir_1_arg {
+	shift->Document->find_any( sub {
+		my $main_element=$_[1];
+		$main_element->isa('PPI::Token::Word') or return '';
+		$main_element->content eq 'mkdir'       or return '';
+		return '' if is_hash_key($main_element);
+		return '' if is_method_call($main_element);
+		return '' if is_subroutine_name($main_element);
+		return '' if is_included_module_name($main_element);
+		return '' if is_package_declaration($main_element);
+		my @arguments = parse_arg_list($main_element);
+		if ( scalar @arguments != 2 ) {
+			return 1;
+		}
+		return '';
+	} );
+}
+
+sub _splice_negative_length {
+	shift->Document->find_any( sub {
+		my $main_element=$_[1];
+		$main_element->isa('PPI::Token::Word') or return '';
+		$main_element->content eq 'splice'       or return '';
+		return '' if is_hash_key($main_element);
+		return '' if is_method_call($main_element);
+		return '' if is_subroutine_name($main_element);
+		return '' if is_included_module_name($main_element);
+		return '' if is_package_declaration($main_element);
+
+		my @arguments = parse_arg_list($main_element);
+		if ( scalar @arguments < 3 ) {
+			return '';
+		}
+		my $arg=$arguments[2];
+		if (ref($arg) eq 'ARRAY') {
+		  $arg=$arg->[0];
+		}
+		if ($arg->isa('PPI::Token::Number')) {
+			if ($arg->literal<0) {
+				return 1;
+			} else {
+				return '';
+			}
+		}
+		return '';
+	} );
+
 }
 
 sub _postfix_foreach {

Modified: trunk/libperl-minimumversion-perl/t/03_open_3arg.t
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libperl-minimumversion-perl/t/03_open_3arg.t?rev=47893&op=diff
==============================================================================
--- trunk/libperl-minimumversion-perl/t/03_open_3arg.t (original)
+++ trunk/libperl-minimumversion-perl/t/03_open_3arg.t Sun Nov 29 06:13:55 2009
@@ -17,20 +17,22 @@
     q{open INFO,   "<  datafile"  or die;},
     q{open(INFO,      "datafile") || die("can't open datafile: $!");},
     q{open my $fh, ">$output";},
-
+    q/if(open my $fh, $output) {}/,
 );
 my @examples_3arg=(
     q{open A,'<','test.txt';},
     q{open( INFO, ">", $datafile ) || die "Can't create $datafile: $!";},
+    q{open( INFO, ">", $datafile )},
     q{open my $fh, '>', $output;},
+    q/if(open my $fh, '>', $output) {}/,
     q{open my $fh, '|-', 'test','arg1';},
 );
 plan tests =>(@examples_3arg+ at examples_not3arg);
 foreach my $example (@examples_not3arg) {
         my $p = Perl::MinimumVersion->new(\$example);
-        is($p->_three_argument_open,'');
+        is($p->_three_argument_open,'',$example);
 }
 foreach my $example (@examples_3arg) {
         my $p = Perl::MinimumVersion->new(\$example);
-        is($p->_three_argument_open,1);
+        is($p->_three_argument_open,1,$example);
 }

Modified: trunk/libperl-minimumversion-perl/t/04_substr.t
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libperl-minimumversion-perl/t/04_substr.t?rev=47893&op=diff
==============================================================================
--- trunk/libperl-minimumversion-perl/t/04_substr.t (original)
+++ trunk/libperl-minimumversion-perl/t/04_substr.t Sun Nov 29 06:13:55 2009
@@ -14,11 +14,12 @@
     q{substr 'asdf',1,1 or print 2,2;},
     q{substr('asdf',1,1);},
     q{my $a=substr('asdf',1,1);},
+    q{$a->substr('asdf',1,1,'aa');},
 );
 my @examples_yes=(
     q{substr('asdf',1,1,'tt');},
     q{my $a=substr('asdf',1,1,'aa');},
-    q{if(substr('asdf',1,1,'aa')) {}},
+    q/if(substr('asdf',1,1,'aa')) {}/,
 );
 plan tests =>(@examples_yes+ at examples_not);
 foreach my $example (@examples_not) {




More information about the Pkg-perl-cvs-commits mailing list