r47758 - in /trunk/libperl-minimumversion-perl: ./ debian/ inc/Module/ inc/Module/Install/ lib/Perl/ t/
ansgar-guest at users.alioth.debian.org
ansgar-guest at users.alioth.debian.org
Wed Nov 25 14:37:34 UTC 2009
Author: ansgar-guest
Date: Wed Nov 25 14:37:17 2009
New Revision: 47758
URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=47758
Log:
* New upstream release
+ add (build-)dependency on libperl-critic-perl (>= 1.104)
* Use minimal debian/rules.
* Add perl (>= 5.10.1) as an alternative to the libpod-simple-perl
build-dependency.
* Make (build-)dep on perl unversioned as allowed by Policy 3.8.3.
* Bump Standards-Version to 3.8.3.
Added:
trunk/libperl-minimumversion-perl/t/04_substr.t
- copied unchanged from r47757, branches/upstream/libperl-minimumversion-perl/current/t/04_substr.t
trunk/libperl-minimumversion-perl/t/05_foreach.t
- copied unchanged from r47757, branches/upstream/libperl-minimumversion-perl/current/t/05_foreach.t
trunk/libperl-minimumversion-perl/t/06_weaken.t
- copied unchanged from r47757, branches/upstream/libperl-minimumversion-perl/current/t/06_weaken.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/debian/rules
trunk/libperl-minimumversion-perl/inc/Module/Install.pm
trunk/libperl-minimumversion-perl/inc/Module/Install/Base.pm
trunk/libperl-minimumversion-perl/inc/Module/Install/Can.pm
trunk/libperl-minimumversion-perl/inc/Module/Install/Fetch.pm
trunk/libperl-minimumversion-perl/inc/Module/Install/Makefile.pm
trunk/libperl-minimumversion-perl/inc/Module/Install/Metadata.pm
trunk/libperl-minimumversion-perl/inc/Module/Install/Scripts.pm
trunk/libperl-minimumversion-perl/inc/Module/Install/Win32.pm
trunk/libperl-minimumversion-perl/inc/Module/Install/With.pm
trunk/libperl-minimumversion-perl/inc/Module/Install/WriteAll.pm
trunk/libperl-minimumversion-perl/lib/Perl/MinimumVersion.pm
trunk/libperl-minimumversion-perl/t/02_main.t
trunk/libperl-minimumversion-perl/t/03_open_3arg.t
trunk/libperl-minimumversion-perl/t/99_pmv.t
Modified: trunk/libperl-minimumversion-perl/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libperl-minimumversion-perl/Changes?rev=47758&op=diff
==============================================================================
--- trunk/libperl-minimumversion-perl/Changes (original)
+++ trunk/libperl-minimumversion-perl/Changes Wed Nov 25 14:37:17 2009
@@ -1,4 +1,15 @@
Revision history for Perl extension Perl-MinimumVersion
+
+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)
+ 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)
+ - Scalar::Util::weaken requires perl 5.006 (Alexandr Ciornii)
+ - P::MV itself found imcompatibility in 02_main.t with 5.5 (Alexandr Ciornii)
1.20 Sat 4 Apr 2009
- Change 5.005_03 to 5.005.05 (ADAMK)
@@ -13,7 +24,7 @@
- Updating PPI and several other dependencies to get a more
accurate parse on which to run the analysis.
- Add a dependency on File::Find::Rule::Perl instead of using
- a deplicate (worse) copy of the code for it.
+ a duplicate (worse) copy of the code for it.
- If perlver is run in a CPAN-style distribution don't parse
blib or _build directories (but DO parse inc)
Modified: trunk/libperl-minimumversion-perl/MANIFEST
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libperl-minimumversion-perl/MANIFEST?rev=47758&op=diff
==============================================================================
--- trunk/libperl-minimumversion-perl/MANIFEST (original)
+++ trunk/libperl-minimumversion-perl/MANIFEST Wed Nov 25 14:37:17 2009
@@ -19,6 +19,9 @@
t/01_compile.t
t/02_main.t
t/03_open_3arg.t
+t/04_substr.t
+t/05_foreach.t
+t/06_weaken.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=47758&op=diff
==============================================================================
--- trunk/libperl-minimumversion-perl/META.yml (original)
+++ trunk/libperl-minimumversion-perl/META.yml Wed Nov 25 14:37:17 2009
@@ -3,13 +3,14 @@
author:
- 'Adam Kennedy <adamk at cpan.org>'
build_requires:
+ ExtUtils::MakeMaker: 6.42
File::Spec: 0.80
Test::More: 0.47
Test::Script: 1.03
configure_requires:
- ExtUtils::MakeMaker: 6.48
+ ExtUtils::MakeMaker: 6.42
distribution_type: module
-generated_by: 'Module::Install version 0.81'
+generated_by: 'Module::Install version 0.91'
license: perl
meta-spec:
url: http://module-build.sourceforge.net/META-spec-v1.4.html
@@ -26,10 +27,11 @@
List::Util: 1.18
PPI: 1.201
Params::Util: 0.25
+ Perl::Critic::Utils: 1.104
perl: 5.005
version: 0.76
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.20
+version: 1.21
Modified: trunk/libperl-minimumversion-perl/Makefile.PL
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libperl-minimumversion-perl/Makefile.PL?rev=47758&op=diff
==============================================================================
--- trunk/libperl-minimumversion-perl/Makefile.PL (original)
+++ trunk/libperl-minimumversion-perl/Makefile.PL Wed Nov 25 14:37:17 2009
@@ -1,4 +1,4 @@
-use inc::Module::Install 0.81;
+use inc::Module::Install 0.82;
all_from 'lib/Perl/MinimumVersion.pm';
@@ -10,6 +10,7 @@
requires 'File::Find::Rule' => '0.30';
requires 'File::Find::Rule::Perl' => '1.04';
requires 'PPI' => '1.201';
+requires 'Perl::Critic::Utils' => '1.104';
test_requires 'File::Spec' => '0.80';
test_requires 'Test::More' => '0.47';
test_requires 'Test::Script' => '1.03';
Modified: trunk/libperl-minimumversion-perl/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libperl-minimumversion-perl/debian/changelog?rev=47758&op=diff
==============================================================================
--- trunk/libperl-minimumversion-perl/debian/changelog (original)
+++ trunk/libperl-minimumversion-perl/debian/changelog Wed Nov 25 14:37:17 2009
@@ -1,4 +1,4 @@
-libperl-minimumversion-perl (1.20-2) UNRELEASED; urgency=low
+libperl-minimumversion-perl (1.21-1) unstable; urgency=low
[ Nathan Handler ]
* debian/watch: Update to ignore development releases.
@@ -7,7 +7,16 @@
* debian/control: Changed: (build-)depend on perl instead of perl-
modules.
- -- Nathan Handler <nhandler at ubuntu.com> Sat, 06 Jun 2009 01:36:53 +0000
+ [ Ansgar Burchardt ]
+ * New upstream release
+ + add (build-)dependency on libperl-critic-perl (>= 1.104)
+ * Use minimal debian/rules.
+ * Add perl (>= 5.10.1) as an alternative to the libpod-simple-perl
+ build-dependency.
+ * Make (build-)dep on perl unversioned as allowed by Policy 3.8.3.
+ * Bump Standards-Version to 3.8.3.
+
+ -- Ansgar Burchardt <ansgar at 43-1.org> Wed, 25 Nov 2009 23:37:07 +0900
libperl-minimumversion-perl (1.20-1) unstable; urgency=low
Modified: trunk/libperl-minimumversion-perl/debian/control
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libperl-minimumversion-perl/debian/control?rev=47758&op=diff
==============================================================================
--- trunk/libperl-minimumversion-perl/debian/control (original)
+++ trunk/libperl-minimumversion-perl/debian/control Wed Nov 25 14:37:17 2009
@@ -2,26 +2,28 @@
Section: perl
Priority: optional
Build-Depends: debhelper (>= 7)
-Build-Depends-Indep: perl (>= 5.005),
+Build-Depends-Indep: perl,
libppi-perl (>= 1.201), 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,
- libpod-simple-perl (>= 3.07), libtest-minimumversion-perl,
- perl (>= 5.10.0) | libversion-perl (>=0.74)
+ perl (>= 5.10.1) | libpod-simple-perl (>= 3.07), libtest-minimumversion-perl,
+ perl (>= 5.10.0) | 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>
-Standards-Version: 3.8.1
+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/
Vcs-Browser: http://svn.debian.org/viewsvn/pkg-perl/trunk/libperl-minimumversion-perl/
Package: libperl-minimumversion-perl
Architecture: all
-Depends: perl (>= 5.005), ${misc:Depends}, libppi-perl (>= 1.201),
+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)
+ perl (>= 5.10.0) | libversion-perl (>=0.74),
+ 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
Modified: trunk/libperl-minimumversion-perl/debian/rules
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libperl-minimumversion-perl/debian/rules?rev=47758&op=diff
==============================================================================
--- trunk/libperl-minimumversion-perl/debian/rules (original)
+++ trunk/libperl-minimumversion-perl/debian/rules Wed Nov 25 14:37:17 2009
@@ -1,26 +1,3 @@
#!/usr/bin/make -f
-
-# Needed to get all tests
-export AUTOMATED_TESTING=true
-
-build: build-stamp
-build-stamp:
- dh build
- touch $@
-
-clean:
- dh $@
-
-install: install-stamp
-install-stamp: build-stamp
- dh install
- touch $@
-
-binary-arch:
-
-binary-indep: install
- dh $@
-
-binary: binary-arch binary-indep
-
-.PHONY: binary binary-arch binary-indep install clean build
+%:
+ AUTOMATED_TESTING=true dh $@
Modified: trunk/libperl-minimumversion-perl/inc/Module/Install.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libperl-minimumversion-perl/inc/Module/Install.pm?rev=47758&op=diff
==============================================================================
--- trunk/libperl-minimumversion-perl/inc/Module/Install.pm (original)
+++ trunk/libperl-minimumversion-perl/inc/Module/Install.pm Wed Nov 25 14:37:17 2009
@@ -17,12 +17,10 @@
# 3. The ./inc/ version of Module::Install loads
# }
-BEGIN {
- require 5.004;
-}
+use 5.005;
use strict 'vars';
-use vars qw{$VERSION};
+use vars qw{$VERSION $MAIN};
BEGIN {
# All Module::Install core packages now require synchronised versions.
# This will be used to ensure we don't accidentally load old or
@@ -30,7 +28,10 @@
# This is not enforced yet, but will be some time in the next few
# releases once we can make sure it won't clash with custom
# Module::Install extensions.
- $VERSION = '0.81';
+ $VERSION = '0.91';
+
+ # Storage for the pseudo-singleton
+ $MAIN = undef;
*inc::Module::Install::VERSION = *VERSION;
@inc::Module::Install::ISA = __PACKAGE__;
@@ -93,6 +94,7 @@
+
# Build.PL was formerly supported, but no longer is due to excessive
# difficulty in implementing every single feature twice.
if ( $0 =~ /Build.PL$/i ) { die <<"END_DIE" }
@@ -131,14 +133,22 @@
$sym->{$cwd} = sub {
my $pwd = Cwd::cwd();
if ( my $code = $sym->{$pwd} ) {
- # delegate back to parent dirs
+ # Delegate back to parent dirs
goto &$code unless $cwd eq $pwd;
}
$$sym =~ /([^:]+)$/ or die "Cannot autoload $who - $sym";
- unless ( uc($1) eq $1 ) {
- unshift @_, ( $self, $1 );
- goto &{$self->can('call')};
+ my $method = $1;
+ if ( uc($method) eq $method ) {
+ # Do nothing
+ return;
+ } elsif ( $method =~ /^_/ and $self->can($method) ) {
+ # Dispatch to the root M:I class
+ return $self->$method(@_);
}
+
+ # Dispatch to the appropriate plugin
+ unshift @_, ( $self, $1 );
+ goto &{$self->can('call')};
};
}
@@ -163,6 +173,9 @@
delete $INC{"$self->{file}"};
delete $INC{"$self->{path}.pm"};
+ # Save to the singleton
+ $MAIN = $self;
+
return 1;
}
@@ -176,8 +189,7 @@
my @exts = @{$self->{extensions}};
unless ( @exts ) {
- my $admin = $self->{admin};
- @exts = $admin->load_all_extensions;
+ @exts = $self->{admin}->load_all_extensions;
}
my %seen;
@@ -260,7 +272,7 @@
sub load_extensions {
my ($self, $path, $top) = @_;
- unless ( grep { !ref $_ and lc $_ eq lc $self->{prefix} } @INC ) {
+ unless ( grep { ! ref $_ and lc $_ eq lc $self->{prefix} } @INC ) {
unshift @INC, $self->{prefix};
}
@@ -341,7 +353,7 @@
if ( $] >= 5.006 ) {
open( FH, '<', $_[0] ) or die "open($_[0]): $!";
} else {
- open( FH, "< $_[0]" ) or die "open($_[0]): $!";
+ open( FH, "< $_[0]" ) or die "open($_[0]): $!";
}
my $string = do { local $/; <FH> };
close FH or die "close($_[0]): $!";
@@ -372,7 +384,7 @@
if ( $] >= 5.006 ) {
open( FH, '>', $_[0] ) or die "open($_[0]): $!";
} else {
- open( FH, "> $_[0]" ) or die "open($_[0]): $!";
+ open( FH, "> $_[0]" ) or die "open($_[0]): $!";
}
foreach ( 1 .. $#_ ) {
print FH $_[$_] or die "print($_[0]): $!";
Modified: trunk/libperl-minimumversion-perl/inc/Module/Install/Base.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libperl-minimumversion-perl/inc/Module/Install/Base.pm?rev=47758&op=diff
==============================================================================
--- trunk/libperl-minimumversion-perl/inc/Module/Install/Base.pm (original)
+++ trunk/libperl-minimumversion-perl/inc/Module/Install/Base.pm Wed Nov 25 14:37:17 2009
@@ -1,7 +1,11 @@
#line 1
package Module::Install::Base;
-$VERSION = '0.81';
+use strict 'vars';
+use vars qw{$VERSION};
+BEGIN {
+ $VERSION = '0.91';
+}
# Suspend handler for "redefined" warnings
BEGIN {
@@ -9,54 +13,56 @@
$SIG{__WARN__} = sub { $w };
}
-### This is the ONLY module that shouldn't have strict on
-# use strict;
-
-#line 41
+#line 42
sub new {
- my ($class, %args) = @_;
-
- foreach my $method ( qw(call load) ) {
- *{"$class\::$method"} = sub {
- shift()->_top->$method(@_);
- } unless defined &{"$class\::$method"};
- }
-
- bless( \%args, $class );
+ my $class = shift;
+ unless ( defined &{"${class}::call"} ) {
+ *{"${class}::call"} = sub { shift->_top->call(@_) };
+ }
+ unless ( defined &{"${class}::load"} ) {
+ *{"${class}::load"} = sub { shift->_top->load(@_) };
+ }
+ bless { @_ }, $class;
}
#line 61
sub AUTOLOAD {
- my $self = shift;
- local $@;
- my $autoload = eval { $self->_top->autoload } or return;
- goto &$autoload;
+ local $@;
+ my $func = eval { shift->_top->autoload } or return;
+ goto &$func;
}
-#line 76
+#line 75
-sub _top { $_[0]->{_top} }
+sub _top {
+ $_[0]->{_top};
+}
-#line 89
+#line 90
sub admin {
- $_[0]->_top->{admin} or Module::Install::Base::FakeAdmin->new;
+ $_[0]->_top->{admin}
+ or
+ Module::Install::Base::FakeAdmin->new;
}
-#line 101
+#line 106
sub is_admin {
- $_[0]->admin->VERSION;
+ $_[0]->admin->VERSION;
}
sub DESTROY {}
package Module::Install::Base::FakeAdmin;
-my $Fake;
-sub new { $Fake ||= bless(\@_, $_[0]) }
+my $fake;
+
+sub new {
+ $fake ||= bless(\@_, $_[0]);
+}
sub AUTOLOAD {}
@@ -69,4 +75,4 @@
1;
-#line 146
+#line 154
Modified: trunk/libperl-minimumversion-perl/inc/Module/Install/Can.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libperl-minimumversion-perl/inc/Module/Install/Can.pm?rev=47758&op=diff
==============================================================================
--- trunk/libperl-minimumversion-perl/inc/Module/Install/Can.pm (original)
+++ trunk/libperl-minimumversion-perl/inc/Module/Install/Can.pm Wed Nov 25 14:37:17 2009
@@ -2,16 +2,16 @@
package Module::Install::Can;
use strict;
-use Module::Install::Base;
-use Config ();
-use File::Spec ();
-use ExtUtils::MakeMaker ();
+use Config ();
+use File::Spec ();
+use ExtUtils::MakeMaker ();
+use Module::Install::Base ();
-use vars qw{$VERSION $ISCORE @ISA};
+use vars qw{$VERSION @ISA $ISCORE};
BEGIN {
- $VERSION = '0.81';
+ $VERSION = '0.91';
+ @ISA = 'Module::Install::Base';
$ISCORE = 1;
- @ISA = qw{Module::Install::Base};
}
# check if we can load some module
Modified: trunk/libperl-minimumversion-perl/inc/Module/Install/Fetch.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libperl-minimumversion-perl/inc/Module/Install/Fetch.pm?rev=47758&op=diff
==============================================================================
--- trunk/libperl-minimumversion-perl/inc/Module/Install/Fetch.pm (original)
+++ trunk/libperl-minimumversion-perl/inc/Module/Install/Fetch.pm Wed Nov 25 14:37:17 2009
@@ -2,13 +2,13 @@
package Module::Install::Fetch;
use strict;
-use Module::Install::Base;
+use Module::Install::Base ();
-use vars qw{$VERSION $ISCORE @ISA};
+use vars qw{$VERSION @ISA $ISCORE};
BEGIN {
- $VERSION = '0.81';
+ $VERSION = '0.91';
+ @ISA = 'Module::Install::Base';
$ISCORE = 1;
- @ISA = qw{Module::Install::Base};
}
sub get_file {
Modified: trunk/libperl-minimumversion-perl/inc/Module/Install/Makefile.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libperl-minimumversion-perl/inc/Module/Install/Makefile.pm?rev=47758&op=diff
==============================================================================
--- trunk/libperl-minimumversion-perl/inc/Module/Install/Makefile.pm (original)
+++ trunk/libperl-minimumversion-perl/inc/Module/Install/Makefile.pm Wed Nov 25 14:37:17 2009
@@ -2,14 +2,14 @@
package Module::Install::Makefile;
use strict 'vars';
-use Module::Install::Base;
-use ExtUtils::MakeMaker ();
-
-use vars qw{$VERSION $ISCORE @ISA};
+use ExtUtils::MakeMaker ();
+use Module::Install::Base ();
+
+use vars qw{$VERSION @ISA $ISCORE};
BEGIN {
- $VERSION = '0.81';
+ $VERSION = '0.91';
+ @ISA = 'Module::Install::Base';
$ISCORE = 1;
- @ISA = qw{Module::Install::Base};
}
sub Makefile { $_[0] }
@@ -114,17 +114,32 @@
my $self = shift;
die "&Makefile->write() takes no arguments\n" if @_;
- # Make sure we have a new enough
+ # Check the current Perl version
+ my $perl_version = $self->perl_version;
+ if ( $perl_version ) {
+ eval "use $perl_version; 1"
+ or die "ERROR: perl: Version $] is installed, "
+ . "but we need version >= $perl_version";
+ }
+
+ # Make sure we have a new enough MakeMaker
require ExtUtils::MakeMaker;
- # MakeMaker can complain about module versions that include
- # an underscore, even though its own version may contain one!
- # Hence the funny regexp to get rid of it. See RT #35800
- # for details.
-
- $self->configure_requires( 'ExtUtils::MakeMaker' => $ExtUtils::MakeMaker::VERSION =~ /^(\d+\.\d+)/ );
-
- # Generate the
+ if ( $perl_version and $self->_cmp($perl_version, '5.006') >= 0 ) {
+ # MakeMaker can complain about module versions that include
+ # an underscore, even though its own version may contain one!
+ # Hence the funny regexp to get rid of it. See RT #35800
+ # for details.
+ $self->build_requires( 'ExtUtils::MakeMaker' => $ExtUtils::MakeMaker::VERSION =~ /^(\d+\.\d+)/ );
+ $self->configure_requires( 'ExtUtils::MakeMaker' => $ExtUtils::MakeMaker::VERSION =~ /^(\d+\.\d+)/ );
+ } else {
+ # Allow legacy-compatibility with 5.005 by depending on the
+ # most recent EU:MM that supported 5.005.
+ $self->build_requires( 'ExtUtils::MakeMaker' => 6.42 );
+ $self->configure_requires( 'ExtUtils::MakeMaker' => 6.42 );
+ }
+
+ # Generate the MakeMaker params
my $args = $self->makemaker_args;
$args->{DISTNAME} = $self->name;
$args->{NAME} = $self->module_name || $self->name;
@@ -133,7 +148,7 @@
if ( $self->tests ) {
$args->{test} = { TESTS => $self->tests };
}
- if ($] >= 5.005) {
+ if ( $] >= 5.005 ) {
$args->{ABSTRACT} = $self->abstract;
$args->{AUTHOR} = $self->author;
}
@@ -147,7 +162,7 @@
delete $args->{SIGN};
}
- # merge both kinds of requires into prereq_pm
+ # Merge both kinds of requires into prereq_pm
my $prereq = ($args->{PREREQ_PM} ||= {});
%$prereq = ( %$prereq,
map { @$_ }
@@ -250,4 +265,4 @@
__END__
-#line 379
+#line 394
Modified: trunk/libperl-minimumversion-perl/inc/Module/Install/Metadata.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libperl-minimumversion-perl/inc/Module/Install/Metadata.pm?rev=47758&op=diff
==============================================================================
--- trunk/libperl-minimumversion-perl/inc/Module/Install/Metadata.pm (original)
+++ trunk/libperl-minimumversion-perl/inc/Module/Install/Metadata.pm Wed Nov 25 14:37:17 2009
@@ -2,18 +2,17 @@
package Module::Install::Metadata;
use strict 'vars';
-use Module::Install::Base;
+use Module::Install::Base ();
use vars qw{$VERSION @ISA $ISCORE};
BEGIN {
- $VERSION = '0.81';
- @ISA = qw{Module::Install::Base};
+ $VERSION = '0.91';
+ @ISA = 'Module::Install::Base';
$ISCORE = 1;
}
my @boolean_keys = qw{
sign
- mymeta
};
my @scalar_keys = qw{
@@ -440,21 +439,21 @@
/ixms ) {
my $license_text = $1;
my @phrases = (
- 'under the same (?:terms|license) as perl itself' => 'perl', 1,
- 'GNU general public license' => 'gpl', 1,
- 'GNU public license' => 'gpl', 1,
- 'GNU lesser general public license' => 'lgpl', 1,
- 'GNU lesser public license' => 'lgpl', 1,
- 'GNU library general public license' => 'lgpl', 1,
- 'GNU library public license' => 'lgpl', 1,
- 'BSD license' => 'bsd', 1,
- 'Artistic license' => 'artistic', 1,
- 'GPL' => 'gpl', 1,
- 'LGPL' => 'lgpl', 1,
- 'BSD' => 'bsd', 1,
- 'Artistic' => 'artistic', 1,
- 'MIT' => 'mit', 1,
- 'proprietary' => 'proprietary', 0,
+ 'under the same (?:terms|license) as (?:perl|the perl programming language) itself' => 'perl', 1,
+ 'GNU general public license' => 'gpl', 1,
+ 'GNU public license' => 'gpl', 1,
+ 'GNU lesser general public license' => 'lgpl', 1,
+ 'GNU lesser public license' => 'lgpl', 1,
+ 'GNU library general public license' => 'lgpl', 1,
+ 'GNU library public license' => 'lgpl', 1,
+ 'BSD license' => 'bsd', 1,
+ 'Artistic license' => 'artistic', 1,
+ 'GPL' => 'gpl', 1,
+ 'LGPL' => 'lgpl', 1,
+ 'BSD' => 'bsd', 1,
+ 'Artistic' => 'artistic', 1,
+ 'MIT' => 'mit', 1,
+ 'proprietary' => 'proprietary', 0,
);
while ( my ($pattern, $license, $osi) = splice(@phrases, 0, 3) ) {
$pattern =~ s{\s+}{\\s+}g;
@@ -506,17 +505,29 @@
}
}
+sub test_requires_from {
+ my $self = shift;
+ my $content = Module::Install::_readperl($_[0]);
+ my @requires = $content =~ m/^use\s+([^\W\d]\w*(?:::\w+)*)\s+([\d\.]+)/mg;
+ while ( @requires ) {
+ my $module = shift @requires;
+ my $version = shift @requires;
+ $self->test_requires( $module => $version );
+ }
+}
+
# Convert triple-part versions (eg, 5.6.1 or 5.8.9) to
# numbers (eg, 5.006001 or 5.008009).
# Also, convert double-part versions (eg, 5.8)
sub _perl_version {
my $v = $_[-1];
- $v =~ s/^([1-9])\.([1-9]\d?\d?)$/sprintf("%d.%03d",$1,$2)/e;
+ $v =~ s/^([1-9])\.([1-9]\d?\d?)$/sprintf("%d.%03d",$1,$2)/e;
$v =~ s/^([1-9])\.([1-9]\d?\d?)\.(0|[1-9]\d?\d?)$/sprintf("%d.%03d%03d",$1,$2,$3 || 0)/e;
$v =~ s/(\.\d\d\d)000$/$1/;
$v =~ s/_.+$//;
if ( ref($v) ) {
- $v = $v + 0; # Numify
+ # Numify
+ $v = $v + 0;
}
return $v;
}
@@ -526,21 +537,56 @@
######################################################################
-# MYMETA.yml Support
+# MYMETA Support
sub WriteMyMeta {
die "WriteMyMeta has been deprecated";
}
-sub write_mymeta {
- my $self = shift;
-
- # If there's no existing META.yml there is nothing we can do
- return unless -f 'META.yml';
+sub write_mymeta_yaml {
+ my $self = shift;
# We need YAML::Tiny to write the MYMETA.yml file
unless ( eval { require YAML::Tiny; 1; } ) {
return 1;
+ }
+
+ # Generate the data
+ my $meta = $self->_write_mymeta_data or return 1;
+
+ # Save as the MYMETA.yml file
+ print "Writing MYMETA.yml\n";
+ YAML::Tiny::DumpFile('MYMETA.yml', $meta);
+}
+
+sub write_mymeta_json {
+ my $self = shift;
+
+ # We need JSON to write the MYMETA.json file
+ unless ( eval { require JSON; 1; } ) {
+ return 1;
+ }
+
+ # Generate the data
+ my $meta = $self->_write_mymeta_data or return 1;
+
+ # Save as the MYMETA.yml file
+ print "Writing MYMETA.json\n";
+ Module::Install::_write(
+ 'MYMETA.json',
+ JSON->new->pretty(1)->canonical->encode($meta),
+ );
+}
+
+sub _write_mymeta_data {
+ my $self = shift;
+
+ # If there's no existing META.yml there is nothing we can do
+ return undef unless -f 'META.yml';
+
+ # We need Parse::CPAN::Meta to load the file
+ unless ( eval { require Parse::CPAN::Meta; 1; } ) {
+ return undef;
}
# Merge the perl version into the dependencies
@@ -558,7 +604,7 @@
}
# Load the advisory META.yml file
- my @yaml = YAML::Tiny::LoadFile('META.yml');
+ my @yaml = Parse::CPAN::Meta::LoadFile('META.yml');
my $meta = $yaml[0];
# Overwrite the non-configure dependency hashs
@@ -572,9 +618,7 @@
$meta->{build_requires} = { map { @$_ } @{ $val->{build_requires} } };
}
- # Save as the MYMETA.yml file
- print "Writing MYMETA.yml\n";
- YAML::Tiny::DumpFile('MYMETA.yml', $meta);
+ return $meta;
}
1;
Modified: trunk/libperl-minimumversion-perl/inc/Module/Install/Scripts.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libperl-minimumversion-perl/inc/Module/Install/Scripts.pm?rev=47758&op=diff
==============================================================================
--- trunk/libperl-minimumversion-perl/inc/Module/Install/Scripts.pm (original)
+++ trunk/libperl-minimumversion-perl/inc/Module/Install/Scripts.pm Wed Nov 25 14:37:17 2009
@@ -2,13 +2,13 @@
package Module::Install::Scripts;
use strict 'vars';
-use Module::Install::Base;
+use Module::Install::Base ();
-use vars qw{$VERSION $ISCORE @ISA};
+use vars qw{$VERSION @ISA $ISCORE};
BEGIN {
- $VERSION = '0.81';
+ $VERSION = '0.91';
+ @ISA = 'Module::Install::Base';
$ISCORE = 1;
- @ISA = qw{Module::Install::Base};
}
sub install_script {
Modified: trunk/libperl-minimumversion-perl/inc/Module/Install/Win32.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libperl-minimumversion-perl/inc/Module/Install/Win32.pm?rev=47758&op=diff
==============================================================================
--- trunk/libperl-minimumversion-perl/inc/Module/Install/Win32.pm (original)
+++ trunk/libperl-minimumversion-perl/inc/Module/Install/Win32.pm Wed Nov 25 14:37:17 2009
@@ -2,12 +2,12 @@
package Module::Install::Win32;
use strict;
-use Module::Install::Base;
+use Module::Install::Base ();
use vars qw{$VERSION @ISA $ISCORE};
BEGIN {
- $VERSION = '0.81';
- @ISA = qw{Module::Install::Base};
+ $VERSION = '0.91';
+ @ISA = 'Module::Install::Base';
$ISCORE = 1;
}
Modified: trunk/libperl-minimumversion-perl/inc/Module/Install/With.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libperl-minimumversion-perl/inc/Module/Install/With.pm?rev=47758&op=diff
==============================================================================
--- trunk/libperl-minimumversion-perl/inc/Module/Install/With.pm (original)
+++ trunk/libperl-minimumversion-perl/inc/Module/Install/With.pm Wed Nov 25 14:37:17 2009
@@ -4,13 +4,13 @@
# See POD at end for docs
use strict;
-use Module::Install::Base;
+use Module::Install::Base ();
-use vars qw{$VERSION $ISCORE @ISA};
+use vars qw{$VERSION @ISA $ISCORE};
BEGIN {
- $VERSION = '0.81';
+ $VERSION = '0.91';
+ @ISA = 'Module::Install::Base';
$ISCORE = 1;
- @ISA = qw{Module::Install::Base};
}
Modified: trunk/libperl-minimumversion-perl/inc/Module/Install/WriteAll.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libperl-minimumversion-perl/inc/Module/Install/WriteAll.pm?rev=47758&op=diff
==============================================================================
--- trunk/libperl-minimumversion-perl/inc/Module/Install/WriteAll.pm (original)
+++ trunk/libperl-minimumversion-perl/inc/Module/Install/WriteAll.pm Wed Nov 25 14:37:17 2009
@@ -2,11 +2,11 @@
package Module::Install::WriteAll;
use strict;
-use Module::Install::Base;
+use Module::Install::Base ();
use vars qw{$VERSION @ISA $ISCORE};
BEGIN {
- $VERSION = '0.81';
+ $VERSION = '0.91';;
@ISA = qw{Module::Install::Base};
$ISCORE = 1;
}
@@ -41,8 +41,18 @@
# The Makefile write process adds a couple of dependencies,
# so write the META.yml files after the Makefile.
- $self->Meta->write if $args{meta};
- $self->Meta->write_mymeta if $self->mymeta;
+ if ( $args{meta} ) {
+ $self->Meta->write;
+ }
+
+ # Experimental support for MYMETA
+ if ( $ENV{X_MYMETA} ) {
+ if ( $ENV{X_MYMETA} eq 'JSON' ) {
+ $self->Meta->write_mymeta_json;
+ } else {
+ $self->Meta->write_mymeta_yaml;
+ }
+ }
return 1;
}
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=47758&op=diff
==============================================================================
--- trunk/libperl-minimumversion-perl/lib/Perl/MinimumVersion.pm (original)
+++ trunk/libperl-minimumversion-perl/lib/Perl/MinimumVersion.pm Wed Nov 25 14:37:17 2009
@@ -43,10 +43,11 @@
use Params::Util ('_INSTANCE', '_CLASS');
use PPI::Util ('_Document');
use PPI ();
+use Perl::Critic::Utils 1.104 qw{ :characters :severities :data_conversion :classification :ppi};
use vars qw{$VERSION @ISA @EXPORT_OK %CHECKS %MATCHES};
BEGIN {
- $VERSION = '1.20';
+ $VERSION = '1.21';
# Export the PMV convenience constant
@ISA = 'Exporter';
@@ -73,10 +74,12 @@
_perl_5006_pragmas => version->new('5.006'),
_any_our_variables => version->new('5.006'),
_any_binary_literals => version->new('5.006'),
+ _any_version_literals => version->new('5.006'), #v-string
_magic_version => version->new('5.006'),
_any_attributes => version->new('5.006'),
_any_CHECK_blocks => version->new('5.006'),
- # _three_argument_open => version->new('5.006'),
+ _three_argument_open => version->new('5.006'),
+ _weaken => version->new('5.006'),
_any_qr_tokens => version->new('5.005.03'),
_perl_5005_pragmas => version->new('5.005'),
@@ -84,6 +87,9 @@
_any_tied_arrays => version->new('5.005'),
_any_quotelike_regexp => version->new('5.005'),
_any_INIT_blocks => version->new('5.005'),
+ _substr_4_arg => version->new('5.005'),
+
+ _postfix_foreach => version->new('5.004.05'),
);
# Predefine some indexes needed by various check methods
@@ -113,6 +119,7 @@
open => 1,
filetest => 1,
charnames => 1,
+ bytes => 1,
},
_perl_5005_pragmas => {
re => 1,
@@ -554,6 +561,13 @@
} );
}
+sub _any_version_literals {
+ shift->Document->find_any( sub {
+ $_[1]->isa('PPI::Token::Number::Version')
+ } );
+}
+
+
sub _magic_version {
shift->Document->find_any( sub {
$_[1]->isa('PPI::Token::Magic')
@@ -596,7 +610,8 @@
and (
$_[1]->module eq 'Tie::Array'
or
- ($_[1]->module =~ /\bException\b/ and $_[1]->module !~ /^CPAN::/)
+ ($_[1]->module =~ /\bException\b/ and
+ $_[1]->module !~ /^(?:CPAN)::/)
or
$_[1]->module =~ /\bThread\b/
or
@@ -671,26 +686,74 @@
$_[1]->isa('PPI::Statement') or return '';
my @children=$_[1]->children;
@children >= 7 or return '';
- $children[0]->isa('PPI::Token::Word') or return '';
- $children[0]->content eq 'open' or return '';
- my $comma=0;
- foreach my $n (@children) {
- if ($n->isa('PPI::Token::Operator')) {
- if ($n->content eq ',') {
- $comma++;
- } else {
- 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 > 2 ) {
+ return 1;
}
- return '' if $comma<2;
+ return '';
+ } );
+
+}
+
+
+sub _substr_4_arg {
+ shift->Document->find_any( sub {
+ my $main_element=$_[1];
+ $main_element->isa('PPI::Token::Word') or return '';
+ $main_element->content eq 'substr' or return '';
+ my @arguments = parse_arg_list($main_element);
+ if ( scalar @arguments > 3 ) {
+ return 1;
+ }
+ return '';
+ } );
+}
+
+sub _postfix_foreach {
+ shift->Document->find_any( sub {
+ my $main_element=$_[1];
+ $main_element->isa('PPI::Token::Word') or return '';
+ $main_element->content eq 'foreach' 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 $stmnt = $main_element->statement();
+ return '' if !$stmnt;
+ return '' if $stmnt->isa('PPI::Statement::Compound');
return 1;
} );
-
-}
-
-
-
+}
+
+# weak references require perl 5.6
+# will not work in case of importing several
+sub _weaken {
+ shift->Document->find_any( sub {
+ (
+ $_[1]->isa('PPI::Statement::Include')
+ and
+ $_[1]->module eq 'Scalar::Util'
+ and
+ $_[1]->content =~ /[^:]\b(?:weaken|isweak)\b[^:]/
+ )
+ or
+ (
+ $_[1]->isa('PPI::Token::Word')
+ and
+ (
+ $_[1]->content eq 'Scalar::Util::isweak'
+ or
+ $_[1]->content eq 'Scalar::Util::weaken'
+ )
+ #and
+ #is_function_call($_[1])
+ )
+ } );
+}
#####################################################################
Modified: trunk/libperl-minimumversion-perl/t/02_main.t
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libperl-minimumversion-perl/t/02_main.t?rev=47758&op=diff
==============================================================================
--- trunk/libperl-minimumversion-perl/t/02_main.t (original)
+++ trunk/libperl-minimumversion-perl/t/02_main.t Wed Nov 25 14:37:17 2009
@@ -8,7 +8,7 @@
$^W = 1;
}
-use Test::More tests => 70;
+use Test::More tests => 74;
use version;
use File::Spec::Functions ':ALL';
use PPI;
@@ -55,12 +55,12 @@
version->new(5.006),
'_max(two) returns the higher version' );
-is_deeply( Perl::MinimumVersion::_max(version->new(5.006), version->new(5.004), version->new(5.5.3)),
+is_deeply( Perl::MinimumVersion::_max(version->new(5.006), version->new(5.004), version->new('5.5.3')),
version->new(5.006),
'_max(three) returns the higher version' );
-is_deeply( Perl::MinimumVersion::_max(version->new(5.006), version->new(5.8.4), undef, version->new(5.004), '', version->new(5.5.3)),
- version->new(5.8.4),
+is_deeply( Perl::MinimumVersion::_max(version->new(5.006), version->new('5.8.4'), undef, version->new(5.004), '', version->new('5.5.3')),
+ version->new('5.8.4'),
'_max(three) returns the higher version' );
# Check the _max support function (bad)
@@ -85,12 +85,12 @@
version->new(5.006),
'_max(two) returns the higher version (as method)' );
-is_deeply( PMV->_max(version->new(5.006), version->new(5.004), version->new(5.5.3)),
+is_deeply( PMV->_max(version->new(5.006), version->new(5.004), version->new('5.5.3')),
version->new(5.006),
'_max(three) returns the higher version (as method)' );
-is_deeply( PMV->_max(version->new(5.006), version->new(5.8.4), undef, version->new(5.004), '', version->new(5.5.3)),
- version->new(5.8.4),
+is_deeply( PMV->_max(version->new(5.006), version->new('5.8.4'), undef, version->new(5.004), '', version->new('5.5.3')),
+ version->new('5.8.4'),
'_max(three) returns the higher version (as method)' );
# Constructor testing
@@ -184,6 +184,14 @@
use mro 'c3';
END_PERL
is( $v->_perl_5010_pragmas, 1, '->_any_our_variables returns true' );
+}
+
+# Check "version number"
+SCOPE: {
+my $v = version_is( <<'END_PERL', '5.006', '"version number" detected' );
+my $a=v1.1.1;
+END_PERL
+is( $v->_any_version_literals, 1, '->_any_version_literals returns true' );
}
# Check the localized soft refernence pragma
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=47758&op=diff
==============================================================================
--- trunk/libperl-minimumversion-perl/t/03_open_3arg.t (original)
+++ trunk/libperl-minimumversion-perl/t/03_open_3arg.t Wed Nov 25 14:37:17 2009
@@ -8,20 +8,22 @@
use Test::More;
-BEGIN {
- plan skip_all => "not yet implemented";
-}
#use version;
use Perl::MinimumVersion;
my @examples_not3arg=(
q{close $x;},
q{open A,'test.txt'},
q{open INFO, "< datafile" or print "can't open datafile: ",$!;},
+ q{open INFO, "< datafile" or die;},
q{open(INFO, "datafile") || die("can't open datafile: $!");},
+ q{open my $fh, ">$output";},
+
);
my @examples_3arg=(
q{open A,'<','test.txt';},
q{open( INFO, ">", $datafile ) || die "Can't create $datafile: $!";},
+ q{open my $fh, '>', $output;},
+ q{open my $fh, '|-', 'test','arg1';},
);
plan tests =>(@examples_3arg+ at examples_not3arg);
foreach my $example (@examples_not3arg) {
Modified: trunk/libperl-minimumversion-perl/t/99_pmv.t
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libperl-minimumversion-perl/t/99_pmv.t?rev=47758&op=diff
==============================================================================
--- trunk/libperl-minimumversion-perl/t/99_pmv.t (original)
+++ trunk/libperl-minimumversion-perl/t/99_pmv.t Wed Nov 25 14:37:17 2009
@@ -8,7 +8,10 @@
$^W = 1;
}
-my $MODULE = 'Test::MinimumVersion 0.008';
+my @MODULES = (
+ 'Perl::MinimumVersion 1.20',
+ 'Test::MinimumVersion 0.008',
+);
# Don't run tests for installs
use Test::More;
@@ -16,12 +19,14 @@
plan( skip_all => "Author tests not required for installation" );
}
-# Load the testing module
-eval "use $MODULE";
-if ( $@ ) {
- $ENV{RELEASE_TESTING}
- ? die( "Failed to load required release-testing module $MODULE" )
- : plan( skip_all => "$MODULE not available for testing" );
+# Load the testing modules
+foreach my $MODULE ( @MODULES ) {
+ eval "use $MODULE";
+ if ( $@ ) {
+ $ENV{RELEASE_TESTING}
+ ? die( "Failed to load required release-testing module $MODULE" )
+ : plan( skip_all => "$MODULE not available for testing" );
+ }
}
all_minimum_version_from_metayml_ok();
More information about the Pkg-perl-cvs-commits
mailing list