r69811 - in /branches/upstream/libperl-minimumversion-perl/current: ./ inc/Module/Install/ lib/Perl/ lib/Perl/MinimumVersion/ script/ t/
jawnsy-guest at users.alioth.debian.org
jawnsy-guest at users.alioth.debian.org
Sun Feb 27 02:25:22 UTC 2011
Author: jawnsy-guest
Date: Sun Feb 27 02:25:13 2011
New Revision: 69811
URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=69811
Log:
[svn-upgrade] new version libperl-minimumversion-perl (1.27)
Added:
branches/upstream/libperl-minimumversion-perl/current/inc/Module/Install/DSL.pm
branches/upstream/libperl-minimumversion-perl/current/t/12_double_colon.t
Removed:
branches/upstream/libperl-minimumversion-perl/current/inc/Module/Install/With.pm
Modified:
branches/upstream/libperl-minimumversion-perl/current/Changes
branches/upstream/libperl-minimumversion-perl/current/MANIFEST
branches/upstream/libperl-minimumversion-perl/current/META.yml
branches/upstream/libperl-minimumversion-perl/current/Makefile.PL
branches/upstream/libperl-minimumversion-perl/current/README
branches/upstream/libperl-minimumversion-perl/current/lib/Perl/MinimumVersion.pm
branches/upstream/libperl-minimumversion-perl/current/lib/Perl/MinimumVersion/Reason.pm
branches/upstream/libperl-minimumversion-perl/current/script/perlver
branches/upstream/libperl-minimumversion-perl/current/t/02_main.t
branches/upstream/libperl-minimumversion-perl/current/t/10_yada_yada_yada.t
Modified: branches/upstream/libperl-minimumversion-perl/current/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libperl-minimumversion-perl/current/Changes?rev=69811&op=diff
==============================================================================
--- branches/upstream/libperl-minimumversion-perl/current/Changes (original)
+++ branches/upstream/libperl-minimumversion-perl/current/Changes Sun Feb 27 02:25:13 2011
@@ -1,4 +1,12 @@
Revision history for Perl extension Perl-MinimumVersion
+
+1.27 Sat 26 Feb 2011
+ - Updating to Module::Install::DSL 1.00
+ - Updating copyright year
+ - Fix detection of binary numbers (Alexandr Ciornii)
+ - Add check for variables added in 5.5 (Alexandr Ciornii)
+ - Correct detection of different cases of '...' (Alexandr Ciornii)
+ - Detection of bareword that ends with double colon (Alexandr Ciornii)
1.26 Thu 22 Jul 2010
- Detect "package NAME VERSION" in 5.12. (Steffen Mueller)
Modified: branches/upstream/libperl-minimumversion-perl/current/MANIFEST
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libperl-minimumversion-perl/current/MANIFEST?rev=69811&op=diff
==============================================================================
--- branches/upstream/libperl-minimumversion-perl/current/MANIFEST (original)
+++ branches/upstream/libperl-minimumversion-perl/current/MANIFEST Sun Feb 27 02:25:13 2011
@@ -2,12 +2,12 @@
inc/Module/Install.pm
inc/Module/Install/Base.pm
inc/Module/Install/Can.pm
+inc/Module/Install/DSL.pm
inc/Module/Install/Fetch.pm
inc/Module/Install/Makefile.pm
inc/Module/Install/Metadata.pm
inc/Module/Install/Scripts.pm
inc/Module/Install/Win32.pm
-inc/Module/Install/With.pm
inc/Module/Install/WriteAll.pm
lib/Perl/MinimumVersion.pm
lib/Perl/MinimumVersion/Reason.pm
@@ -28,6 +28,7 @@
t/09_pkg_name_version.t
t/10_yada_yada_yada.t
t/11_feature_bundle_512.t
+t/12_double_colon.t
xt/meta.t
xt/pmv.t
xt/pod.t
Modified: branches/upstream/libperl-minimumversion-perl/current/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libperl-minimumversion-perl/current/META.yml?rev=69811&op=diff
==============================================================================
--- branches/upstream/libperl-minimumversion-perl/current/META.yml (original)
+++ branches/upstream/libperl-minimumversion-perl/current/META.yml Sun Feb 27 02:25:13 2011
@@ -25,8 +25,8 @@
requires:
File::Find::Rule: 0.32
File::Find::Rule::Perl: 1.04
- List::Util: 1.18
- PPI: 1.205
+ List::Util: 1.20
+ PPI: 1.215
Params::Util: 0.25
Perl::Critic::Utils: 1.104
perl: 5.6.0
@@ -35,4 +35,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.26
+version: 1.27
Modified: branches/upstream/libperl-minimumversion-perl/current/Makefile.PL
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libperl-minimumversion-perl/current/Makefile.PL?rev=69811&op=diff
==============================================================================
--- branches/upstream/libperl-minimumversion-perl/current/Makefile.PL (original)
+++ branches/upstream/libperl-minimumversion-perl/current/Makefile.PL Sun Feb 27 02:25:13 2011
@@ -1,19 +1,14 @@
-use inc::Module::Install 0.82;
+use inc::Module::Install::DSL 1.00;
-all_from 'lib/Perl/MinimumVersion.pm';
-
-# Push the versioning for version.pm heavily,
-# as it has been through flaky periods
-requires 'version' => '0.76';
-requires 'List::Util' => winlike() ? '1.19' : '1.18';
-requires 'Params::Util' => '0.25';
-requires 'File::Find::Rule' => '0.32';
-requires 'File::Find::Rule::Perl' => '1.04';
-requires 'PPI' => '1.205';
-requires 'Perl::Critic::Utils' => '1.104';
-test_requires 'File::Spec' => '0.80';
-test_requires 'Test::More' => '0.47';
-test_requires 'Test::Script' => '1.03';
-install_script 'perlver';
-
-WriteAll;
+all_from lib/Perl/MinimumVersion.pm
+requires version 0.76
+requires List::Util 1.20
+requires Params::Util 0.25
+requires File::Find::Rule 0.32
+requires File::Find::Rule::Perl 1.04
+requires PPI 1.215
+requires Perl::Critic::Utils 1.104
+test_requires File::Spec 0.80
+test_requires Test::More 0.47
+test_requires Test::Script 1.03
+install_script perlver
Modified: branches/upstream/libperl-minimumversion-perl/current/README
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libperl-minimumversion-perl/current/README?rev=69811&op=diff
==============================================================================
--- branches/upstream/libperl-minimumversion-perl/current/README (original)
+++ branches/upstream/libperl-minimumversion-perl/current/README Sun Feb 27 02:25:13 2011
@@ -147,7 +147,7 @@
<http://ali.as/>, PPI, version
COPYRIGHT
- Copyright 2005 - 2010 Adam Kennedy.
+ Copyright 2005 - 2011 Adam Kennedy.
This program is free software; you can redistribute it and/or modify it
under the same terms as Perl itself.
Added: branches/upstream/libperl-minimumversion-perl/current/inc/Module/Install/DSL.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libperl-minimumversion-perl/current/inc/Module/Install/DSL.pm?rev=69811&op=file
==============================================================================
--- branches/upstream/libperl-minimumversion-perl/current/inc/Module/Install/DSL.pm (added)
+++ branches/upstream/libperl-minimumversion-perl/current/inc/Module/Install/DSL.pm Sun Feb 27 02:25:13 2011
@@ -1,0 +1,94 @@
+#line 1
+package Module::Install::DSL;
+
+use strict;
+use vars qw{$VERSION $ISCORE};
+BEGIN {
+ $VERSION = '1.00';
+ $ISCORE = 1;
+ *inc::Module::Install::DSL::VERSION = *VERSION;
+ @inc::Module::Install::DSL::ISA = __PACKAGE__;
+}
+
+sub import {
+ # Read in the rest of the Makefile.PL
+ open 0 or die "Couldn't open $0: $!";
+ my $dsl;
+ SCOPE: {
+ local $/ = undef;
+ $dsl = join "", <0>;
+ }
+
+ # Change inc::Module::Install::DSL to the regular one.
+ # Remove anything before the use inc::... line.
+ $dsl =~ s/.*?^\s*use\s+(?:inc::)?Module::Install::DSL(\b[^;]*);\s*\n//sm;
+
+ # Load inc::Module::Install as we would in a regular Makefile.Pl
+ SCOPE: {
+ package main;
+ require inc::Module::Install;
+ inc::Module::Install->import;
+ }
+
+ # Add the ::DSL plugin to the list of packages in /inc
+ my $admin = $Module::Install::MAIN->{admin};
+ if ( $admin ) {
+ my $from = $INC{"$admin->{path}/DSL.pm"};
+ my $to = "$admin->{base}/$admin->{prefix}/$admin->{path}/DSL.pm";
+ $admin->copy( $from => $to );
+ }
+
+ # Convert the basic syntax to code
+ my $code = "INIT {\n"
+ . "package main;\n\n"
+ . dsl2code($dsl)
+ . "\n\nWriteAll();\n"
+ . "}\n";
+
+ # Execute the script
+ eval $code;
+ print STDERR "Failed to execute the generated code...\n$@" if $@;
+
+ exit(0);
+}
+
+sub dsl2code {
+ my $dsl = shift;
+
+ # Split into lines and strip blanks
+ my @lines = grep { /\S/ } split /[\012\015]+/, $dsl;
+
+ # Each line represents one command
+ my @code = ();
+ foreach my $line ( @lines ) {
+ # Split the lines into tokens
+ my @tokens = split /\s+/, $line;
+
+ # The first word is the command
+ my $command = shift @tokens;
+ my @params = ();
+ my @suffix = ();
+ while ( @tokens ) {
+ my $token = shift @tokens;
+ if ( $token eq 'if' or $token eq 'unless' ) {
+ # This is the beginning of a suffix
+ push @suffix, $token;
+ push @suffix, @tokens;
+ last;
+ } else {
+ # Convert to a string
+ $token =~ s/([\\\'])/\\$1/g;
+ push @params, "'$token'";
+ }
+ };
+
+ # Merge to create the final line of code
+ @tokens = ( $command, @params ? join( ', ', @params ) : (), @suffix );
+ push @code, join( ' ', @tokens ) . ";\n";
+ }
+
+ # Join into the complete code block
+ return join( '', @code );
+}
+
+1;
Modified: branches/upstream/libperl-minimumversion-perl/current/lib/Perl/MinimumVersion.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libperl-minimumversion-perl/current/lib/Perl/MinimumVersion.pm?rev=69811&op=diff
==============================================================================
--- branches/upstream/libperl-minimumversion-perl/current/lib/Perl/MinimumVersion.pm (original)
+++ branches/upstream/libperl-minimumversion-perl/current/lib/Perl/MinimumVersion.pm Sun Feb 27 02:25:13 2011
@@ -54,7 +54,7 @@
use vars qw{$VERSION @ISA @EXPORT_OK %CHECKS %MATCHES};
BEGIN {
- $VERSION = '1.26';
+ $VERSION = '1.27';
# Only needed for dev releases, comment out otherwise
$VERSION = eval $VERSION;
@@ -104,6 +104,8 @@
_any_INIT_blocks => version->new('5.005'),
_substr_4_arg => version->new('5.005'),
_splice_negative_length => version->new('5.005'),
+ _5005_variables => version->new('5.005'),
+ _bareword_ends_with_double_colon => version->new('5.005'),
_postfix_foreach => version->new('5.004.05'),
);
@@ -515,7 +517,12 @@
sub _yada_yada_yada {
shift->Document->find_first( sub {
$_[1]->isa('PPI::Token::Operator')
- and $_[1]->content eq '...'
+ and $_[1]->content eq '...' or return '';
+ my @child = $_[1]->parent->schildren;
+ @child == 1 and return 1;
+ if (@child == 2) {
+ $child[1]->isa('PPI::Token::Structure')
+ }
} );
}
@@ -661,11 +668,7 @@
sub _any_binary_literals {
shift->Document->find_first( sub {
- $_[1]->isa('PPI::Token::Number')
- and
- $_[1]->{_subtype}
- and
- $_[1]->{_subtype} eq 'binary'
+ $_[1]->isa('PPI::Token::Number::Binary')
} );
}
@@ -805,10 +808,10 @@
sub _three_argument_open {
shift->Document->find_first( sub {
- $_[1]->isa('PPI::Statement') or return '';
- my @children=$_[1]->children;
+ $_[1]->isa('PPI::Statement') or return '';
+ my @children = $_[1]->children;
#@children >= 7 or return '';
- my $main_element=$children[0];
+ 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);
@@ -818,7 +821,6 @@
return '';
} );
}
-
sub _substr_4_arg {
shift->Document->find_first( sub {
@@ -931,6 +933,22 @@
}
+sub _5005_variables {
+ shift->Document->find_first( sub {
+ $_[1]->isa('PPI::Token::Magic')
+ and
+ ($_[1]->content eq '$!' or $_[1]->content eq '$^R')
+ } );
+}
+
+#added in 5.5
+sub _bareword_ends_with_double_colon {
+ shift->Document->find_first( sub {
+ $_[1]->isa('PPI::Token::Word')
+ and
+ $_[1]->content =~ /::$/
+ } );
+}
@@ -1026,7 +1044,7 @@
=head1 COPYRIGHT
-Copyright 2005 - 2010 Adam Kennedy.
+Copyright 2005 - 2011 Adam Kennedy.
This program is free software; you can redistribute
it and/or modify it under the same terms as Perl itself.
Modified: branches/upstream/libperl-minimumversion-perl/current/lib/Perl/MinimumVersion/Reason.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libperl-minimumversion-perl/current/lib/Perl/MinimumVersion/Reason.pm?rev=69811&op=diff
==============================================================================
--- branches/upstream/libperl-minimumversion-perl/current/lib/Perl/MinimumVersion/Reason.pm (original)
+++ branches/upstream/libperl-minimumversion-perl/current/lib/Perl/MinimumVersion/Reason.pm Sun Feb 27 02:25:13 2011
@@ -10,7 +10,7 @@
use vars qw{$VERSION};
BEGIN {
- $VERSION = '1.26';
+ $VERSION = '1.27';
# Only needed for dev releases, comment out otherwise
$VERSION = eval $VERSION;
Modified: branches/upstream/libperl-minimumversion-perl/current/script/perlver
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libperl-minimumversion-perl/current/script/perlver?rev=69811&op=diff
==============================================================================
--- branches/upstream/libperl-minimumversion-perl/current/script/perlver (original)
+++ branches/upstream/libperl-minimumversion-perl/current/script/perlver Sun Feb 27 02:25:13 2011
@@ -57,7 +57,7 @@
use vars qw{$VERSION $VERBOSE $BLAME $EXPLAIN};
BEGIN {
- $VERSION = '1.24';
+ $VERSION = '1.27';
# Configuration globals
$VERBOSE = '';
@@ -306,11 +306,13 @@
my $char = $element->column_number;
my $content = $element->content;
my $rule = $max->rule;
+ my $version = $max->version;
print " ------------------------------------------------------------\n";
- print " File : $file\n";
- print " Line : $line\n";
- print " Char : $char\n";
- print " Rule : $rule\n";
+ print " File : $file\n";
+ print " Line : $line\n";
+ print " Char : $char\n";
+ print " Rule : $rule\n";
+ print " Version : $version\n";
print " ------------------------------------------------------------\n";
print " $content\n";
print " ------------------------------------------------------------\n";
@@ -416,7 +418,7 @@
=head1 COPYRIGHT
-Copyright 2005 - 2010 Adam Kennedy.
+Copyright 2005 - 2011 Adam Kennedy.
This program is free software; you can redistribute
it and/or modify it under the same terms as Perl itself.
Modified: branches/upstream/libperl-minimumversion-perl/current/t/02_main.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libperl-minimumversion-perl/current/t/02_main.t?rev=69811&op=diff
==============================================================================
--- branches/upstream/libperl-minimumversion-perl/current/t/02_main.t (original)
+++ branches/upstream/libperl-minimumversion-perl/current/t/02_main.t Sun Feb 27 02:25:13 2011
@@ -8,7 +8,7 @@
$^W = 1;
}
-use Test::More tests => 75;
+use Test::More tests => 82;
use version;
use File::Spec::Functions ':ALL';
use PPI;
@@ -158,6 +158,14 @@
END_PERL
}
+# Regression: binary
+SCOPE: {
+my $v = version_is( <<'END_PERL', '5.006', 'binary' );
+$c=0b10000001;
+1;
+END_PERL
+}
+
# Check the use of constant hashes
SCOPE: {
my $v = version_is( <<'END_PERL', '5.008', 'constant hash adds a 5.008 dep' );
@@ -181,7 +189,7 @@
my $v = version_is( <<'END_PERL', '5.010', '"use mro" matches expected version' );
use mro 'c3';
END_PERL
-ok( $v->_perl_5010_pragmas, '->_any_our_variables returns true' );
+ok( $v->_perl_5010_pragmas, '->_perl_5010_pragmas returns true' );
}
# Check "version number"
@@ -199,6 +207,16 @@
END_PERL
ok( $v->_local_soft_reference, '->_local_soft_reference returns true' );
}
+
+# Check variables added in 5.5
+SCOPE: {
+my $v = version_is( <<'END_PERL', '5.005', 'variables added in 5.5' );
+$! + $^R;
+END_PERL
+ok( $v->_5005_variables, '->_5005_variables returns true' );
+}
+
+
# Check that minimum_syntax_version's limit param is respected
SCOPE: {
Modified: branches/upstream/libperl-minimumversion-perl/current/t/10_yada_yada_yada.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libperl-minimumversion-perl/current/t/10_yada_yada_yada.t?rev=69811&op=diff
==============================================================================
--- branches/upstream/libperl-minimumversion-perl/current/t/10_yada_yada_yada.t (original)
+++ branches/upstream/libperl-minimumversion-perl/current/t/10_yada_yada_yada.t Sun Feb 27 02:25:13 2011
@@ -12,13 +12,15 @@
use Perl::MinimumVersion;
my @examples_not=(
q{'foo'.'foo'}, # okay, okay, adding close examples is a TODO
- q{sub foo {}},
+ q/sub foo {}/,
+ q{1 ... 3}, #sed version of flip-flop
);
my @examples_yes=(
q{...},
+ q{ ... },
q{...;},
- q{if(1){...}},
- q{sub foo {...}},
+ q/if(1){...}/,
+ q/sub foo {...}/,
);
plan tests =>(@examples_not+ at examples_yes);
foreach my $example (@examples_not) {
Added: branches/upstream/libperl-minimumversion-perl/current/t/12_double_colon.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libperl-minimumversion-perl/current/t/12_double_colon.t?rev=69811&op=file
==============================================================================
--- branches/upstream/libperl-minimumversion-perl/current/t/12_double_colon.t (added)
+++ branches/upstream/libperl-minimumversion-perl/current/t/12_double_colon.t Sun Feb 27 02:25:13 2011
@@ -1,0 +1,34 @@
+#!/usr/bin/perl -w
+
+use strict;
+BEGIN {
+ $| = 1;
+ $^W = 1;
+}
+
+use Test::More;
+
+#use version;
+use Perl::MinimumVersion;
+my @examples_not=(
+ q{A::B::C},
+ q{A::B},
+);
+my @examples_yes=(
+ q{A::B::},
+ q{A::},
+ q{new A::B::},
+ q{new A::B:: $c},
+);
+plan tests =>(@examples_not+ at examples_yes);
+foreach my $example (@examples_not) {
+ my $p = Perl::MinimumVersion->new(\$example);
+ is( $p->_bareword_ends_with_double_colon, '', $example )
+ or do { diag "\$\@: $@" if $@ };
+}
+foreach my $example (@examples_yes) {
+ my $p = Perl::MinimumVersion->new(\$example);
+ ok( $p->_bareword_ends_with_double_colon, "$example - detected")
+ or do { diag "\$\@: $@" if $@ };
+}
+
More information about the Pkg-perl-cvs-commits
mailing list