r30879 - in /trunk/libfile-find-rule-perl-perl: ./ debian/ inc/Module/ inc/Module/Install/ lib/File/Find/Rule/ t/
bricas-guest at users.alioth.debian.org
bricas-guest at users.alioth.debian.org
Thu Feb 19 13:59:35 UTC 2009
Author: bricas-guest
Date: Thu Feb 19 13:59:31 2009
New Revision: 30879
URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=30879
Log:
New upstream release
Added:
trunk/libfile-find-rule-perl-perl/inc/Module/Install/With.pm
- copied unchanged from r30878, branches/upstream/libfile-find-rule-perl-perl/current/inc/Module/Install/With.pm
trunk/libfile-find-rule-perl-perl/t/03_no_index.t
- copied unchanged from r30878, branches/upstream/libfile-find-rule-perl-perl/current/t/03_no_index.t
Modified:
trunk/libfile-find-rule-perl-perl/Changes
trunk/libfile-find-rule-perl-perl/MANIFEST
trunk/libfile-find-rule-perl-perl/META.yml
trunk/libfile-find-rule-perl-perl/Makefile.PL
trunk/libfile-find-rule-perl-perl/README
trunk/libfile-find-rule-perl-perl/debian/changelog
trunk/libfile-find-rule-perl-perl/inc/Module/Install.pm
trunk/libfile-find-rule-perl-perl/inc/Module/Install/Base.pm
trunk/libfile-find-rule-perl-perl/inc/Module/Install/Can.pm
trunk/libfile-find-rule-perl-perl/inc/Module/Install/Fetch.pm
trunk/libfile-find-rule-perl-perl/inc/Module/Install/Makefile.pm
trunk/libfile-find-rule-perl-perl/inc/Module/Install/Metadata.pm
trunk/libfile-find-rule-perl-perl/inc/Module/Install/Win32.pm
trunk/libfile-find-rule-perl-perl/inc/Module/Install/WriteAll.pm
trunk/libfile-find-rule-perl-perl/lib/File/Find/Rule/Perl.pm
trunk/libfile-find-rule-perl-perl/t/97_meta.t
trunk/libfile-find-rule-perl-perl/t/98_pod.t
trunk/libfile-find-rule-perl-perl/t/99_pmv.t
Modified: trunk/libfile-find-rule-perl-perl/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libfile-find-rule-perl-perl/Changes?rev=30879&op=diff
==============================================================================
--- trunk/libfile-find-rule-perl-perl/Changes (original)
+++ trunk/libfile-find-rule-perl-perl/Changes Thu Feb 19 13:59:31 2009
@@ -1,4 +1,8 @@
Revision history for Perl extension File::Find::Rule::Perl
+
+1.05 Thu 19 Feb 2009
+ - Updating to Module::Install 0.79
+ - Adding support for no_index exclusions
1.04 Sat 10 May 2008
- Switching to a production version.
Modified: trunk/libfile-find-rule-perl-perl/MANIFEST
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libfile-find-rule-perl-perl/MANIFEST?rev=30879&op=diff
==============================================================================
--- trunk/libfile-find-rule-perl-perl/MANIFEST (original)
+++ trunk/libfile-find-rule-perl-perl/MANIFEST Thu Feb 19 13:59:31 2009
@@ -6,6 +6,7 @@
inc/Module/Install/Makefile.pm
inc/Module/Install/Metadata.pm
inc/Module/Install/Win32.pm
+inc/Module/Install/With.pm
inc/Module/Install/WriteAll.pm
lib/File/Find/Rule/Perl.pm
LICENSE
@@ -15,6 +16,7 @@
README
t/01_compile.t
t/02_main.t
+t/03_no_index.t
t/97_meta.t
t/98_pod.t
t/99_pmv.t
Modified: trunk/libfile-find-rule-perl-perl/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libfile-find-rule-perl-perl/META.yml?rev=30879&op=diff
==============================================================================
--- trunk/libfile-find-rule-perl-perl/META.yml (original)
+++ trunk/libfile-find-rule-perl-perl/META.yml Thu Feb 19 13:59:31 2009
@@ -3,14 +3,13 @@
author:
- 'Adam Kennedy <adamk at cpan.org>'
build_requires:
- File::Spec: 0.82
Test::More: 0.47
distribution_type: module
-generated_by: 'Module::Install version 0.73'
+generated_by: 'Module::Install version 0.79'
license: perl
meta-spec:
- url: http://module-build.sourceforge.net/META-spec-v1.3.html
- version: 1.3
+ url: http://module-build.sourceforge.net/META-spec-v1.4.html
+ version: 1.4
module_name: File::Find::Rule::Perl
name: File-Find-Rule-Perl
no_index:
@@ -19,5 +18,10 @@
- t
requires:
File::Find::Rule: 0.20
- perl: 5.005
-version: 1.04
+ File::Spec: 0.82
+ Params::Util: 0.38
+ Parse::CPAN::Meta: 0.04
+ perl: 5.00503
+resources:
+ license: http://dev.perl.org/licenses/
+version: 1.05
Modified: trunk/libfile-find-rule-perl-perl/Makefile.PL
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libfile-find-rule-perl-perl/Makefile.PL?rev=30879&op=diff
==============================================================================
--- trunk/libfile-find-rule-perl-perl/Makefile.PL (original)
+++ trunk/libfile-find-rule-perl-perl/Makefile.PL Thu Feb 19 13:59:31 2009
@@ -1,8 +1,10 @@
-use inc::Module::Install;
+use inc::Module::Install 0.79;
all_from 'lib/File/Find/Rule/Perl.pm';
-requires 'File::Find::Rule' => '0.20';
-test_requires 'File::Spec' => '0.82';
-test_requires 'Test::More' => '0.47';
+requires 'File::Spec' => winlike() ? '3.27' : '0.82';
+requires 'File::Find::Rule' => '0.20';
+requires 'Params::Util' => '0.38';
+requires 'Parse::CPAN::Meta' => '0.04';
+test_requires 'Test::More' => '0.47';
WriteAll;
Modified: trunk/libfile-find-rule-perl-perl/README
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libfile-find-rule-perl-perl/README?rev=30879&op=diff
==============================================================================
--- trunk/libfile-find-rule-perl-perl/README (original)
+++ trunk/libfile-find-rule-perl-perl/README Thu Feb 19 13:59:31 2009
@@ -8,15 +8,21 @@
# Find all Perl files smaller than 10k
my @files = File::Find::Rule->perl_file
->size('<10Ki')
- ->in( $dir );
+ ->in('dir');
+
+ # Locate all the modules that PAUSE will index
+ my @mod = File::Find::Rule->no_index
+ ->perl_module
+ ->in('My-Distribution');
DESCRIPTION
I write a lot of things that muck with Perl files. And it always annoyed
me that finding "perl files" requires a moderately complex
File::Find::Rule pattern.
- File::Find::Rule::Perl provides methods for finding various Perl-related
- files.
+ File::Find::Rule::Perl provides methods for finding various types
+ Perl-related files, or replicating search queries run on a distribution
+ in various parts of the CPAN ecosystem.
METHODS
perl_module
@@ -49,6 +55,25 @@
This includes all the files matching the above "perl_module",
"perl_test", "perl_installer" and "perl_script" rules.
+ no_index
+ # Provide the rules directly
+ $rule->no_index(
+ directory => [ 'inc', 't', 'examples' ],
+ file => [ 'Foo.pm', 'lib/Foo.pm' ],
+ );
+
+ # Provide a META.yml to use
+ $rule->no_index( 'META.yml' );
+
+ # Provide a dist root directory to look for a META.yml in
+ $rule->no_index( 'My-Distribution' );
+
+ # Automatically pick up a META.yml from the target directory
+ $rule->no_index->in( 'My-Distribution' );
+
+ The "no_index" method applies a set of rules as per the no_index section
+ in a "META.yml" file.
+
SUPPORT
Bugs should always be submitted via the CPAN bug tracker
@@ -63,7 +88,7 @@
<http://ali.as/>, File::Find::Rule, File::Find::Rule::PPI
COPYRIGHT
- Copyright 2006 - 2008 Adam Kennedy.
+ Copyright 2006 - 2009 Adam Kennedy.
This program is free software; you can redistribute it and/or modify it
under the same terms as Perl itself.
Modified: trunk/libfile-find-rule-perl-perl/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libfile-find-rule-perl-perl/debian/changelog?rev=30879&op=diff
==============================================================================
--- trunk/libfile-find-rule-perl-perl/debian/changelog (original)
+++ trunk/libfile-find-rule-perl-perl/debian/changelog Thu Feb 19 13:59:31 2009
@@ -1,9 +1,13 @@
-libfile-find-rule-perl-perl (1.04-2) UNRELEASED; urgency=low
+libfile-find-rule-perl-perl (1.05-1) UNRELEASED; urgency=low
+ [ Brian Cassidy ]
+ * New upstream release
+
+ [ gregor herrmann ]
* debian/control: Changed: Switched Vcs-Browser field to ViewSVN
(source stanza).
- -- gregor herrmann <gregoa at debian.org> Sun, 16 Nov 2008 20:42:44 +0100
+ -- Brian Cassidy <brian.cassidy at gmail.com> Thu, 19 Feb 2009 09:54:34 -0400
libfile-find-rule-perl-perl (1.04-1) unstable; urgency=low
Modified: trunk/libfile-find-rule-perl-perl/inc/Module/Install.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libfile-find-rule-perl-perl/inc/Module/Install.pm?rev=30879&op=diff
==============================================================================
--- trunk/libfile-find-rule-perl-perl/inc/Module/Install.pm (original)
+++ trunk/libfile-find-rule-perl-perl/inc/Module/Install.pm Thu Feb 19 13:59:31 2009
@@ -30,7 +30,7 @@
# 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.73';
+ $VERSION = '0.79';
*inc::Module::Install::VERSION = *VERSION;
@inc::Module::Install::ISA = __PACKAGE__;
@@ -85,7 +85,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 or -f 'Build.PL' ) { die <<"END_DIE" }
+if ( $0 =~ /Build.PL$/i ) { die <<"END_DIE" }
Module::Install no longer supports Build.PL.
@@ -125,8 +125,10 @@
goto &$code unless $cwd eq $pwd;
}
$$sym =~ /([^:]+)$/ or die "Cannot autoload $who - $sym";
- unshift @_, ( $self, $1 );
- goto &{$self->can('call')} unless uc($1) eq $1;
+ unless ( uc($1) eq $1 ) {
+ unshift @_, ( $self, $1 );
+ goto &{$self->can('call')};
+ }
};
}
@@ -248,7 +250,7 @@
sub load_extensions {
my ($self, $path, $top) = @_;
- unless ( grep { lc $_ eq lc $self->{prefix} } @INC ) {
+ unless ( grep { !ref $_ and lc $_ eq lc $self->{prefix} } @INC ) {
unshift @INC, $self->{prefix};
}
@@ -339,7 +341,10 @@
close FH or die "close($_[0]): $!";
}
-sub _version {
+# _version is for processing module versions (eg, 1.03_05) not
+# Perl versions (eg, 5.8.1).
+
+sub _version ($) {
my $s = shift || 0;
$s =~ s/^(\d+)\.?//;
my $l = $1 || 0;
@@ -348,6 +353,17 @@
return $l + 0;
}
+# Cloned from Params::Util::_CLASS
+sub _CLASS ($) {
+ (
+ defined $_[0]
+ and
+ ! ref $_[0]
+ and
+ $_[0] =~ m/^[^\W\d]\w*(?:::\w+)*$/s
+ ) ? $_[0] : undef;
+}
+
1;
-# Copyright 2008 Adam Kennedy.
+# Copyright 2008 - 2009 Adam Kennedy.
Modified: trunk/libfile-find-rule-perl-perl/inc/Module/Install/Base.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libfile-find-rule-perl-perl/inc/Module/Install/Base.pm?rev=30879&op=diff
==============================================================================
--- trunk/libfile-find-rule-perl-perl/inc/Module/Install/Base.pm (original)
+++ trunk/libfile-find-rule-perl-perl/inc/Module/Install/Base.pm Thu Feb 19 13:59:31 2009
@@ -1,7 +1,7 @@
#line 1
package Module::Install::Base;
-$VERSION = '0.73';
+$VERSION = '0.79';
# Suspend handler for "redefined" warnings
BEGIN {
@@ -45,6 +45,8 @@
$_[0]->_top->{admin} or Module::Install::Base::FakeAdmin->new;
}
+#line 101
+
sub is_admin {
$_[0]->admin->VERSION;
}
@@ -67,4 +69,4 @@
1;
-#line 138
+#line 146
Modified: trunk/libfile-find-rule-perl-perl/inc/Module/Install/Can.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libfile-find-rule-perl-perl/inc/Module/Install/Can.pm?rev=30879&op=diff
==============================================================================
--- trunk/libfile-find-rule-perl-perl/inc/Module/Install/Can.pm (original)
+++ trunk/libfile-find-rule-perl-perl/inc/Module/Install/Can.pm Thu Feb 19 13:59:31 2009
@@ -11,7 +11,7 @@
use vars qw{$VERSION $ISCORE @ISA};
BEGIN {
- $VERSION = '0.73';
+ $VERSION = '0.79';
$ISCORE = 1;
@ISA = qw{Module::Install::Base};
}
@@ -39,6 +39,7 @@
return $_cmd if (-x $_cmd or $_cmd = MM->maybe_command($_cmd));
for my $dir ((split /$Config::Config{path_sep}/, $ENV{PATH}), '.') {
+ next if $dir eq '';
my $abs = File::Spec->catfile($dir, $_[1]);
return $abs if (-x $abs or $abs = MM->maybe_command($abs));
}
@@ -79,4 +80,4 @@
__END__
-#line 157
+#line 158
Modified: trunk/libfile-find-rule-perl-perl/inc/Module/Install/Fetch.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libfile-find-rule-perl-perl/inc/Module/Install/Fetch.pm?rev=30879&op=diff
==============================================================================
--- trunk/libfile-find-rule-perl-perl/inc/Module/Install/Fetch.pm (original)
+++ trunk/libfile-find-rule-perl-perl/inc/Module/Install/Fetch.pm Thu Feb 19 13:59:31 2009
@@ -6,20 +6,20 @@
use vars qw{$VERSION $ISCORE @ISA};
BEGIN {
- $VERSION = '0.73';
+ $VERSION = '0.79';
$ISCORE = 1;
@ISA = qw{Module::Install::Base};
}
sub get_file {
my ($self, %args) = @_;
- my ($scheme, $host, $path, $file) =
+ my ($scheme, $host, $path, $file) =
$args{url} =~ m|^(\w+)://([^/]+)(.+)/(.+)| or return;
if ( $scheme eq 'http' and ! eval { require LWP::Simple; 1 } ) {
$args{url} = $args{ftp_url}
or (warn("LWP support unavailable!\n"), return);
- ($scheme, $host, $path, $file) =
+ ($scheme, $host, $path, $file) =
$args{url} =~ m|^(\w+)://([^/]+)(.+)/(.+)| or return;
}
Modified: trunk/libfile-find-rule-perl-perl/inc/Module/Install/Makefile.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libfile-find-rule-perl-perl/inc/Module/Install/Makefile.pm?rev=30879&op=diff
==============================================================================
--- trunk/libfile-find-rule-perl-perl/inc/Module/Install/Makefile.pm (original)
+++ trunk/libfile-find-rule-perl-perl/inc/Module/Install/Makefile.pm Thu Feb 19 13:59:31 2009
@@ -7,7 +7,7 @@
use vars qw{$VERSION $ISCORE @ISA};
BEGIN {
- $VERSION = '0.73';
+ $VERSION = '0.79';
$ISCORE = 1;
@ISA = qw{Module::Install::Base};
}
@@ -36,9 +36,9 @@
sub makemaker_args {
my $self = shift;
- my $args = ($self->{makemaker_args} ||= {});
- %$args = ( %$args, @_ ) if @_;
- $args;
+ my $args = ( $self->{makemaker_args} ||= {} );
+ %$args = ( %$args, @_ );
+ return $args;
}
# For mm args that take multiple space-seperated args,
@@ -64,7 +64,7 @@
my $self = shift;
my $clean = $self->makemaker_args->{clean} ||= {};
%$clean = (
- %$clean,
+ %$clean,
FILES => join ' ', grep { length $_ } ($clean->{FILES} || (), @_),
);
}
@@ -73,7 +73,7 @@
my $self = shift;
my $realclean = $self->makemaker_args->{realclean} ||= {};
%$realclean = (
- %$realclean,
+ %$realclean,
FILES => join ' ', grep { length $_ } ($realclean->{FILES} || (), @_),
);
}
@@ -116,9 +116,15 @@
# Make sure we have a new enough
require ExtUtils::MakeMaker;
- $self->configure_requires( 'ExtUtils::MakeMaker' => $ExtUtils::MakeMaker::VERSION );
-
- # Generate the
+
+ # 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
my $args = $self->makemaker_args;
$args->{DISTNAME} = $self->name;
$args->{NAME} = $self->module_name || $self->name;
@@ -175,7 +181,9 @@
my $user_preop = delete $args{dist}->{PREOP};
if (my $preop = $self->admin->preop($user_preop)) {
- $args{dist} = $preop;
+ foreach my $key ( keys %$preop ) {
+ $args{dist}->{$key} = $preop->{$key};
+ }
}
my $mm = ExtUtils::MakeMaker::WriteMakefile(%args);
@@ -188,7 +196,7 @@
my $top_class = ref($self->_top) || '';
my $top_version = $self->_top->VERSION || '';
- my $preamble = $self->preamble
+ my $preamble = $self->preamble
? "# Preamble by $top_class $top_version\n"
. $self->preamble
: '';
@@ -242,4 +250,4 @@
__END__
-#line 371
+#line 379
Modified: trunk/libfile-find-rule-perl-perl/inc/Module/Install/Metadata.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libfile-find-rule-perl-perl/inc/Module/Install/Metadata.pm?rev=30879&op=diff
==============================================================================
--- trunk/libfile-find-rule-perl-perl/inc/Module/Install/Metadata.pm (original)
+++ trunk/libfile-find-rule-perl-perl/inc/Module/Install/Metadata.pm Thu Feb 19 13:59:31 2009
@@ -6,7 +6,7 @@
use vars qw{$VERSION $ISCORE @ISA};
BEGIN {
- $VERSION = '0.73';
+ $VERSION = '0.79';
$ISCORE = 1;
@ISA = qw{Module::Install::Base};
}
@@ -17,9 +17,7 @@
abstract
author
version
- license
distribution_type
- perl_version
tests
installdirs
};
@@ -30,13 +28,21 @@
requires
recommends
bundles
+ resources
};
-sub Meta { shift }
-sub Meta_ScalarKeys { @scalar_keys }
-sub Meta_TupleKeys { @tuple_keys }
-
-foreach my $key (@scalar_keys) {
+my @resource_keys = qw{
+ homepage
+ bugtracker
+ repository
+};
+
+sub Meta { shift }
+sub Meta_ScalarKeys { @scalar_keys }
+sub Meta_TupleKeys { @tuple_keys }
+sub Meta_ResourceKeys { @resource_keys }
+
+foreach my $key ( @scalar_keys ) {
*$key = sub {
my $self = shift;
return $self->{values}{$key} if defined wantarray and !@_;
@@ -45,12 +51,30 @@
};
}
+foreach my $key ( @resource_keys ) {
+ *$key = sub {
+ my $self = shift;
+ unless ( @_ ) {
+ return () unless $self->{values}{resources};
+ return map { $_->[1] }
+ grep { $_->[0] eq $key }
+ @{ $self->{values}{resources} };
+ }
+ return $self->{values}{resources}{$key} unless @_;
+ my $uri = shift or die(
+ "Did not provide a value to $key()"
+ );
+ $self->resources( $key => $uri );
+ return 1;
+ };
+}
+
sub requires {
my $self = shift;
while ( @_ ) {
my $module = shift or last;
my $version = shift || 0;
- push @{ $self->{values}->{requires} }, [ $module, $version ];
+ push @{ $self->{values}{requires} }, [ $module, $version ];
}
$self->{values}{requires};
}
@@ -60,7 +84,7 @@
while ( @_ ) {
my $module = shift or last;
my $version = shift || 0;
- push @{ $self->{values}->{build_requires} }, [ $module, $version ];
+ push @{ $self->{values}{build_requires} }, [ $module, $version ];
}
$self->{values}{build_requires};
}
@@ -70,7 +94,7 @@
while ( @_ ) {
my $module = shift or last;
my $version = shift || 0;
- push @{ $self->{values}->{configure_requires} }, [ $module, $version ];
+ push @{ $self->{values}{configure_requires} }, [ $module, $version ];
}
$self->{values}{configure_requires};
}
@@ -80,7 +104,7 @@
while ( @_ ) {
my $module = shift or last;
my $version = shift || 0;
- push @{ $self->{values}->{recommends} }, [ $module, $version ];
+ push @{ $self->{values}{recommends} }, [ $module, $version ];
}
$self->{values}{recommends};
}
@@ -90,9 +114,31 @@
while ( @_ ) {
my $module = shift or last;
my $version = shift || 0;
- push @{ $self->{values}->{bundles} }, [ $module, $version ];
+ push @{ $self->{values}{bundles} }, [ $module, $version ];
}
$self->{values}{bundles};
+}
+
+# Resource handling
+my %lc_resource = map { $_ => 1 } qw{
+ homepage
+ license
+ bugtracker
+ repository
+};
+
+sub resources {
+ my $self = shift;
+ while ( @_ ) {
+ my $name = shift or last;
+ my $value = shift or next;
+ if ( $name eq lc $name and ! $lc_resource{$name} ) {
+ die("Unsupported reserved lowercase resource '$name'");
+ }
+ $self->{values}{resources} ||= [];
+ push @{ $self->{values}{resources} }, [ $name, $value ];
+ }
+ $self->{values}{resources};
}
# Aliases for build_requires that will have alternative
@@ -108,30 +154,70 @@
sub sign {
my $self = shift;
- return $self->{'values'}{'sign'} if defined wantarray and ! @_;
- $self->{'values'}{'sign'} = ( @_ ? $_[0] : 1 );
+ return $self->{values}{sign} if defined wantarray and ! @_;
+ $self->{values}{sign} = ( @_ ? $_[0] : 1 );
return $self;
}
sub dynamic_config {
my $self = shift;
unless ( @_ ) {
- warn "You MUST provide an explicit true/false value to dynamic_config, skipping\n";
+ warn "You MUST provide an explicit true/false value to dynamic_config\n";
return $self;
}
$self->{values}{dynamic_config} = $_[0] ? 1 : 0;
- return $self;
+ return 1;
+}
+
+sub perl_version {
+ my $self = shift;
+ return $self->{values}{perl_version} unless @_;
+ my $version = shift or die(
+ "Did not provide a value to perl_version()"
+ );
+
+ # Normalize the version
+ $version = $self->_perl_version($version);
+
+ # We don't support the reall old versions
+ unless ( $version >= 5.005 ) {
+ die "Module::Install only supports 5.005 or newer (use ExtUtils::MakeMaker)\n";
+ }
+
+ $self->{values}{perl_version} = $version;
+}
+
+sub license {
+ my $self = shift;
+ return $self->{values}{license} unless @_;
+ my $license = shift or die(
+ 'Did not provide a value to license()'
+ );
+ $self->{values}{license} = $license;
+
+ # Automatically fill in license URLs
+ if ( $license eq 'perl' ) {
+ $self->resources( license => 'http://dev.perl.org/licenses/' );
+ }
+
+ return 1;
}
sub all_from {
my ( $self, $file ) = @_;
unless ( defined($file) ) {
- my $name = $self->name
- or die "all_from called with no args without setting name() first";
+ my $name = $self->name or die(
+ "all_from called with no args without setting name() first"
+ );
$file = join('/', 'lib', split(/-/, $name)) . '.pm';
$file =~ s{.*/}{} unless -e $file;
- die "all_from: cannot find $file from $name" unless -e $file;
+ unless ( -e $file ) {
+ die("all_from cannot find $file from $name");
+ }
+ }
+ unless ( -f $file ) {
+ die("The path '$file' does not exist, or is not a file");
}
# Some methods pull from POD instead of code.
@@ -210,8 +296,8 @@
while ( my ( $name, $mods ) = splice( @_, 0, 2 ) ) {
$self->feature( $name, @$mods );
}
- return $self->{values}->{features}
- ? @{ $self->{values}->{features} }
+ return $self->{values}{features}
+ ? @{ $self->{values}{features} }
: ();
}
@@ -285,7 +371,7 @@
$self->module_name($module_name);
}
} else {
- die "Cannot determine name from $file\n";
+ die("Cannot determine name from $file\n");
}
}
@@ -294,7 +380,7 @@
if (
Module::Install::_read($_[0]) =~ m/
^
- use \s*
+ (?:use|require) \s*
v?
([\d_\.]+)
\s* ;
@@ -344,8 +430,12 @@
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,
@@ -358,9 +448,6 @@
while ( my ($pattern, $license, $osi) = splice(@phrases, 0, 3) ) {
$pattern =~ s{\s+}{\\s+}g;
if ( $license_text =~ /\b$pattern\b/i ) {
- if ( $osi and $license_text =~ /All rights reserved/i ) {
- print "WARNING: 'All rights reserved' in copyright may invalidate Open Source license.\n";
- }
$self->license($license);
return 1;
}
@@ -371,19 +458,88 @@
return 'unknown';
}
-sub install_script {
- my $self = shift;
- my $args = $self->makemaker_args;
- my $exe = $args->{EXE_FILES} ||= [];
- foreach ( @_ ) {
- if ( -f $_ ) {
- push @$exe, $_;
- } elsif ( -d 'script' and -f "script/$_" ) {
- push @$exe, "script/$_";
- } else {
- die "Cannot find script '$_'";
- }
- }
+sub bugtracker_from {
+ my $self = shift;
+ my $content = Module::Install::_read($_[0]);
+ my @links = $content =~ m/L\<(http\:\/\/rt\.cpan\.org\/[^>]+)\>/g;
+ unless ( @links ) {
+ warn "Cannot determine bugtracker info from $_[0]\n";
+ return 0;
+ }
+ if ( @links > 1 ) {
+ warn "Found more than on rt.cpan.org link in $_[0]\n";
+ return 0;
+ }
+
+ # Set the bugtracker
+ bugtracker( $links[0] );
+ return 1;
+}
+
+# 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?)\.(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
+ }
+ return $v;
+}
+
+
+
+
+
+######################################################################
+# MYMETA.yml Support
+
+sub WriteMyMeta {
+ $_[0]->write_mymeta;
+}
+
+sub write_mymeta {
+ my $self = shift;
+
+ # If there's no existing META.yml there is nothing we can do
+ return unless -f 'META.yml';
+
+ # Merge the perl version into the dependencies
+ my $val = $self->Meta->{values};
+ my $perl = delete $val->{perl_version};
+ if ( $perl ) {
+ $val->{requires} ||= [];
+ my $requires = $val->{requires};
+
+ # Canonize to three-dot version after Perl 5.6
+ if ( $perl >= 5.006 ) {
+ $perl =~ s{^(\d+)\.(\d\d\d)(\d*)}{join('.', $1, int($2||0), int($3||0))}e
+ }
+ unshift @$requires, [ perl => $perl ];
+ }
+
+ # Load the advisory META.yml file
+ require YAML::Tiny;
+ my @yaml = YAML::Tiny::LoadFile('META.yml');
+ my $meta = $yaml[0];
+
+ # Overwrite the non-configure dependency hashs
+ delete $meta->{requires};
+ delete $meta->{build_requires};
+ delete $meta->{recommends};
+ if ( exists $val->{requires} ) {
+ $meta->{requires} = { map { @$_ } @{ $val->{requires} } };
+ }
+ if ( exists $val->{build_requires} ) {
+ $meta->{build_requires} = { map { @$_ } @{ $val->{build_requires} } };
+ }
+
+ # Save as the MYMETA.yml file
+ YAML::Tiny::DumpFile('MYMETA.yml', $meta);
}
1;
Modified: trunk/libfile-find-rule-perl-perl/inc/Module/Install/Win32.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libfile-find-rule-perl-perl/inc/Module/Install/Win32.pm?rev=30879&op=diff
==============================================================================
--- trunk/libfile-find-rule-perl-perl/inc/Module/Install/Win32.pm (original)
+++ trunk/libfile-find-rule-perl-perl/inc/Module/Install/Win32.pm Thu Feb 19 13:59:31 2009
@@ -6,7 +6,7 @@
use vars qw{$VERSION @ISA $ISCORE};
BEGIN {
- $VERSION = '0.73';
+ $VERSION = '0.79';
@ISA = qw{Module::Install::Base};
$ISCORE = 1;
}
Modified: trunk/libfile-find-rule-perl-perl/inc/Module/Install/WriteAll.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libfile-find-rule-perl-perl/inc/Module/Install/WriteAll.pm?rev=30879&op=diff
==============================================================================
--- trunk/libfile-find-rule-perl-perl/inc/Module/Install/WriteAll.pm (original)
+++ trunk/libfile-find-rule-perl-perl/inc/Module/Install/WriteAll.pm Thu Feb 19 13:59:31 2009
@@ -6,7 +6,7 @@
use vars qw{$VERSION @ISA $ISCORE};
BEGIN {
- $VERSION = '0.73';
+ $VERSION = '0.79';
@ISA = qw{Module::Install::Base};
$ISCORE = 1;
}
Modified: trunk/libfile-find-rule-perl-perl/lib/File/Find/Rule/Perl.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libfile-find-rule-perl-perl/lib/File/Find/Rule/Perl.pm?rev=30879&op=diff
==============================================================================
--- trunk/libfile-find-rule-perl-perl/lib/File/Find/Rule/Perl.pm (original)
+++ trunk/libfile-find-rule-perl-perl/lib/File/Find/Rule/Perl.pm Thu Feb 19 13:59:31 2009
@@ -14,7 +14,12 @@
# Find all Perl files smaller than 10k
my @files = File::Find::Rule->perl_file
->size('<10Ki')
- ->in( $dir );
+ ->in('dir');
+
+ # Locate all the modules that PAUSE will index
+ my @mod = File::Find::Rule->no_index
+ ->perl_module
+ ->in('My-Distribution');
=head1 DESCRIPTION
@@ -22,24 +27,32 @@
me that finding "perl files" requires a moderately complex
L<File::Find::Rule> pattern.
-B<File::Find::Rule::Perl> provides methods for finding various Perl-related
-files.
+B<File::Find::Rule::Perl> provides methods for finding various
+types Perl-related files, or replicating search queries run on a
+distribution in various parts of the CPAN ecosystem.
=head1 METHODS
=cut
-use 5.005;
+use 5.00503;
use strict;
+use Carp;
use UNIVERSAL;
-use base 'File::Find::Rule';
+use File::Spec ();
+use File::Spec::Unix ();
+use Params::Util qw{ _STRING _HASHLIKE };
+use File::Find::Rule ();
+use Parse::CPAN::Meta ();
+
+use vars qw{$VERSION @ISA @EXPORT};
+BEGIN {
+ $VERSION = '1.05';
+ @ISA = 'File::Find::Rule';
+ @EXPORT = @File::Find::Rule::EXPORT;
+}
+
use constant FFR => 'File::Find::Rule';
-
-use vars qw{$VERSION @EXPORT};
-BEGIN {
- $VERSION = '1.04';
- @EXPORT = @File::Find::Rule::EXPORT;
-}
@@ -140,13 +153,121 @@
sub File::Find::Rule::perl_file {
my $self = shift()->_force_object;
- $self->file->or(
- FFR->name( '*.pm', '*.t', '*.pl', 'Makefile.PL', 'Build.PL' ),
+ $self->or(
+ FFR->name( '*.pm', '*.t', '*.pl', 'Makefile.PL', 'Build.PL' )
+ ->file,
FFR->name( qr/^[^.]+$/ )
+ ->file
->exec( \&File::Find::Rule::Perl::_shebang ),
);
}
+=pod
+
+=head2 no_index
+
+ # Provide the rules directly
+ $rule->no_index(
+ directory => [ 'inc', 't', 'examples' ],
+ file => [ 'Foo.pm', 'lib/Foo.pm' ],
+ );
+
+ # Provide a META.yml to use
+ $rule->no_index( 'META.yml' );
+
+ # Provide a dist root directory to look for a META.yml in
+ $rule->no_index( 'My-Distribution' );
+
+ # Automatically pick up a META.yml from the target directory
+ $rule->no_index->in( 'My-Distribution' );
+
+The C<no_index> method applies a set of rules as per the no_index section
+in a C<META.yml> file.
+
+=cut
+
+# There's probably some bugs in this process somewhere,
+sub File::Find::Rule::no_index {
+ my $find = shift()->_force_object;
+
+ # Create the lexical var for the function
+ my $rule;
+
+ # Handle the various param options
+ if ( @_ == 0 ) {
+ # No params means we auto-calculate
+ $rule = undef;
+
+ } elsif ( _HASHLIKE($_[0]) ) {
+ $rule = _no_index($_[0]);
+
+ } elsif ( defined _STRING($_[0]) ) {
+ my $path = shift;
+ if ( -d $path ) {
+ # This is probably a dist directory
+ my $meta = File::Spec->catfile( $path, 'META.yml' );
+ $path = $meta if -f $meta;
+ }
+ if ( -f $path ) {
+ # This is a META.yml file
+ my $meta = Parse::CPAN::Meta::LoadFile($path);
+
+ # Shortcut if there's nothing to do
+ my $no_index = $meta->{no_index};
+ if ( $no_index ) {
+ $rule = _no_index($no_index);
+ }
+ }
+ } else {
+ Carp::croak("Invalid or unsupported parameter type");
+ }
+
+ # Generate the subroutine in advance
+ my $function = sub {
+ my $r = $_[2];
+
+ # In the automated case the first time we are
+ # called we are passed the distribution directory.
+ unless ( defined $rule ) {
+ $rule = { directory => {}, file => {} };
+ my $meta = File::Spec->catfile( $r, 'META.yml' );
+ if ( -d $r and -f $meta ) {
+ my $yaml = Parse::CPAN::Meta::LoadFile($meta);
+ if ( $yaml and $yaml->{no_index} ) {
+ $rule = _no_index( $yaml->{no_index} );
+ }
+ }
+ }
+
+ $rule->{directory}->{$r} and -d $r and return 1;
+ $rule->{file}->{$r} and -f _ and return 1;
+ return 0;
+ };
+
+ # Generate the rule
+ return $find->or(
+ FFR->exec( $function )->prune->discard,
+ FFR->new,
+ );
+}
+
+sub _no_index {
+ my $param = shift;
+
+ # Index the directory and file entries for faster access
+ my %file = $param->{file} ? (
+ map { $_ => 1 } @{$param->{file}}
+ ) : ();
+ my %directory = $param->{directory} ? (
+ map { $_ => 1 } @{$param->{directory}}
+ ) : ();
+
+ return {
+ file => \%file,
+ directory => \%directory,
+ };
+}
+
1;
=pod
@@ -169,7 +290,7 @@
=head1 COPYRIGHT
-Copyright 2006 - 2008 Adam Kennedy.
+Copyright 2006 - 2009 Adam Kennedy.
This program is free software; you can redistribute
it and/or modify it under the same terms as Perl itself.
Modified: trunk/libfile-find-rule-perl-perl/t/97_meta.t
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libfile-find-rule-perl-perl/t/97_meta.t?rev=30879&op=diff
==============================================================================
--- trunk/libfile-find-rule-perl-perl/t/97_meta.t (original)
+++ trunk/libfile-find-rule-perl-perl/t/97_meta.t Thu Feb 19 13:59:31 2009
@@ -8,7 +8,7 @@
$^W = 1;
}
-my $MODULE = 'Test::CPAN::Meta 0.07';
+my $MODULE = 'Test::CPAN::Meta 0.12';
# Don't run tests for installs
use Test::More;
Modified: trunk/libfile-find-rule-perl-perl/t/98_pod.t
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libfile-find-rule-perl-perl/t/98_pod.t?rev=30879&op=diff
==============================================================================
--- trunk/libfile-find-rule-perl-perl/t/98_pod.t (original)
+++ trunk/libfile-find-rule-perl-perl/t/98_pod.t Thu Feb 19 13:59:31 2009
@@ -8,7 +8,10 @@
$^W = 1;
}
-my $MODULE = 'Test::Pod 1.00';
+my @MODULES = (
+ 'Pod::Simple 3.07',
+ 'Test::Pod 1.26',
+);
# Don't run tests for installs
use Test::More;
@@ -16,57 +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_pod_files_ok();
-
-
-
-
-
-
-#####################################################################
-# WARNING: INSANE BLACK MAGIC
-#####################################################################
-
-# Hack Pod::Simple::BlackBox to ignore the Test::Inline
-# "Extended Begin" syntax.
-# For example, "=begin has more than one word errors"
-my $begin;
-if ( $Test::Pod::VERSION ) {
- $begin = \&Pod::Simple::BlackBox::_ponder_begin;
-}
-sub mybegin {
- my $para = $_[1];
- my $content = join ' ', splice @$para, 2;
- $content =~ s/^\s+//s;
- $content =~ s/\s+$//s;
- my @words = split /\s+/, $content;
- if ( $words[0] =~ /^test(?:ing)?\z/s ) {
- foreach ( 2 .. $#$para ) {
- $para->[$_] = '';
- }
- $para->[2] = $words[0];
- }
-
- # Continue as normal
- push @$para, @words;
- return &$begin(@_);
-}
-
-SCOPE: {
- local $^W = 0;
- if ( $Test::Pod::VERSION ) {
- *Pod::Simple::BlackBox::_ponder_begin = \&mybegin;
- }
-}
-
-#####################################################################
-# END BLACK MAGIC
-#####################################################################
Modified: trunk/libfile-find-rule-perl-perl/t/99_pmv.t
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libfile-find-rule-perl-perl/t/99_pmv.t?rev=30879&op=diff
==============================================================================
--- trunk/libfile-find-rule-perl-perl/t/99_pmv.t (original)
+++ trunk/libfile-find-rule-perl-perl/t/99_pmv.t Thu Feb 19 13:59:31 2009
@@ -8,7 +8,7 @@
$^W = 1;
}
-my $MODULE = 'Test::MinimumVersion 0.007';
+my $MODULE = 'Test::MinimumVersion 0.008';
# Don't run tests for installs
use Test::More;
More information about the Pkg-perl-cvs-commits
mailing list