summaryrefslogtreecommitdiff
path: root/cpan
diff options
context:
space:
mode:
authorChris Williams <chris@bingosnet.co.uk>2009-11-05 14:38:29 +0000
committerChris Williams <chris@bingosnet.co.uk>2009-11-05 14:38:29 +0000
commitf395eedc84e42f36a84c71a79c9224f84ec41177 (patch)
tree24e8c52281f5156219896593c47570ca2d883cc8 /cpan
parent97352077e6c6c736a003d2b96eedafe612acf92a (diff)
downloadperl-f395eedc84e42f36a84c71a79c9224f84ec41177.tar.gz
Updated CPANPLUS to cpan version 0.89_07
Diffstat (limited to 'cpan')
-rw-r--r--cpan/CPANPLUS/lib/CPANPLUS.pm2
-rw-r--r--cpan/CPANPLUS/lib/CPANPLUS/Dist.pm82
-rw-r--r--cpan/CPANPLUS/lib/CPANPLUS/Dist/MM.pm7
-rw-r--r--cpan/CPANPLUS/lib/CPANPLUS/Internals.pm2
-rw-r--r--cpan/CPANPLUS/lib/CPANPLUS/Internals/Constants.pm5
-rw-r--r--cpan/CPANPLUS/lib/CPANPLUS/Shell/Default.pm2
6 files changed, 79 insertions, 21 deletions
diff --git a/cpan/CPANPLUS/lib/CPANPLUS.pm b/cpan/CPANPLUS/lib/CPANPLUS.pm
index c10d0c10b1..53be374480 100644
--- a/cpan/CPANPLUS/lib/CPANPLUS.pm
+++ b/cpan/CPANPLUS/lib/CPANPLUS.pm
@@ -13,7 +13,7 @@ BEGIN {
use vars qw( @EXPORT @ISA $VERSION );
@EXPORT = qw( shell fetch get install );
@ISA = qw( Exporter );
- $VERSION = "0.89_06"; #have to hardcode or cpan.org gets unhappy
+ $VERSION = "0.89_07"; #have to hardcode or cpan.org gets unhappy
}
### purely for backward compatibility, so we can call it from the commandline:
diff --git a/cpan/CPANPLUS/lib/CPANPLUS/Dist.pm b/cpan/CPANPLUS/lib/CPANPLUS/Dist.pm
index b6ffdbe478..551b8ec405 100644
--- a/cpan/CPANPLUS/lib/CPANPLUS/Dist.pm
+++ b/cpan/CPANPLUS/lib/CPANPLUS/Dist.pm
@@ -293,23 +293,70 @@ and versions required.
sub find_configure_requires {
my $self = shift;
my $mod = $self->parent;
- my %hash = @_;
+ my $meth = 'configure_requires';
+
+ ### the prereqs as we have them now
+ my @args = (
+ defaults => $mod->status->$meth || {},
+ keys => [ $meth ],
+ );
+
+ ### the default file to use, which may be overriden
+ push @args, ( file => META_YML->( $mod->status->extract ) )
+ if defined $mod->status->extract;
+
+ my $href = $self->_prereqs_from_meta_file( @args, @_ );
+
+ ### and store it in the module
+ $mod->status->$meth( $href );
+
+ return { %$href };
+}
+
+sub find_mymeta_requires {
+ my $self = shift;
+ my $mod = $self->parent;
+ my $meth = 'prereqs';
- my $meta;
+ ### the prereqs as we have them now
+ my @args = (
+ defaults => $mod->status->$meth || {},
+ keys => [qw|requires build_requires|],
+ );
+
+ ### the default file to use, which may be overriden
+ push @args, ( file => MYMETA_YML->( $mod->status->extract ) )
+ if defined $mod->status->extract;
+
+ my $href = $self->_prereqs_from_meta_file( @args, @_ );
+
+ ### and store it in the module
+ $mod->status->$meth( $href );
+
+ return { %$href };
+}
+
+sub _prereqs_from_meta_file {
+ my $self = shift;
+ my $mod = $self->parent;
+ my %hash = @_;
+
+ my( $meta, $defaults, $keys );
my $tmpl = { ### check if we have an extract path. if not, we
### get 'undef value' warnings from file::spec
- file => { default => do { defined $mod->status->extract
+ file => { default => do { defined $mod->status->extract
? META_YML->( $mod->status->extract )
: '' },
- store => \$meta,
- },
+ store => \$meta,
+ },
+ defaults => { required => 1, default => {}, strict_type => 1,
+ store => \$defaults },
+ keys => { required => 1, default => [], strict_type => 1,
+ store => \$keys },
};
check( $tmpl, \%hash ) or return;
- ### default is an empty hashref
- my $configure_requires = $mod->status->configure_requires || {};
-
### if there's a meta file, we read it;
if( -e $meta ) {
@@ -319,22 +366,21 @@ sub find_configure_requires {
unless( $doc ) {
error(loc( "Could not read %1: '%2'", $meta, $@ ));
- return $configure_requires; # Causes problems if we don't return a hashref
+ return $defaults;
}
- ### read the configure_requires key, make sure not to throw
+ ### read the keys now, make sure not to throw
### away anything that was already added
- $configure_requires = {
- %$configure_requires,
- %{ $doc->{'configure_requires'} },
- } if $doc->{'configure_requires'};
+ for my $key ( @$keys ) {
+ $defaults = {
+ %$defaults,
+ %{ $doc->{$key} },
+ } if $doc->{ $key };
+ }
}
- ### and store it in the module
- $mod->status->configure_requires( $configure_requires );
-
### and return a copy
- return \%{$configure_requires};
+ return \%{ $defaults };
}
=head2 $bool = $dist->_resolve_prereqs( ... )
diff --git a/cpan/CPANPLUS/lib/CPANPLUS/Dist/MM.pm b/cpan/CPANPLUS/lib/CPANPLUS/Dist/MM.pm
index 21852ff343..4249ecc741 100644
--- a/cpan/CPANPLUS/lib/CPANPLUS/Dist/MM.pm
+++ b/cpan/CPANPLUS/lib/CPANPLUS/Dist/MM.pm
@@ -465,6 +465,13 @@ sub _find_prereqs {
};
my $args = check( $tmpl, \%hash ) or return;
+
+ ### see if we got prereqs from MYMETA
+ my $prereqs = $dist->find_mymeta_requires();
+
+ ### we found some prereqs, we'll trust MYMETA
+ ### but we do need to run it through the callback
+ return $cb->_callbacks->filter_prereqs->( $cb, $prereqs ) if keys %$prereqs;
my $fh = FileHandle->new();
unless( $fh->open( $file ) ) {
diff --git a/cpan/CPANPLUS/lib/CPANPLUS/Internals.pm b/cpan/CPANPLUS/lib/CPANPLUS/Internals.pm
index 8cd6a82461..d21dc8e0e4 100644
--- a/cpan/CPANPLUS/lib/CPANPLUS/Internals.pm
+++ b/cpan/CPANPLUS/lib/CPANPLUS/Internals.pm
@@ -42,7 +42,7 @@ use vars qw[@ISA $VERSION];
CPANPLUS::Internals::Report
];
-$VERSION = "0.89_06";
+$VERSION = "0.89_07";
=pod
diff --git a/cpan/CPANPLUS/lib/CPANPLUS/Internals/Constants.pm b/cpan/CPANPLUS/lib/CPANPLUS/Internals/Constants.pm
index 1d05c98fe4..1a38200dfb 100644
--- a/cpan/CPANPLUS/lib/CPANPLUS/Internals/Constants.pm
+++ b/cpan/CPANPLUS/lib/CPANPLUS/Internals/Constants.pm
@@ -149,6 +149,11 @@ use constant META_YML => sub { return @_
: 'META.yml';
};
+use constant MYMETA_YML => sub { return @_
+ ? File::Spec->catfile( @_, 'MYMETA.yml' )
+ : 'MYMETA.yml';
+ };
+
use constant BLIB => sub { return @_
? File::Spec->catfile(@_, 'blib')
: 'blib';
diff --git a/cpan/CPANPLUS/lib/CPANPLUS/Shell/Default.pm b/cpan/CPANPLUS/lib/CPANPLUS/Shell/Default.pm
index 04291224f7..b37e2b7381 100644
--- a/cpan/CPANPLUS/lib/CPANPLUS/Shell/Default.pm
+++ b/cpan/CPANPLUS/lib/CPANPLUS/Shell/Default.pm
@@ -26,7 +26,7 @@ local $Data::Dumper::Indent = 1; # for dumpering from !
BEGIN {
use vars qw[ $VERSION @ISA ];
@ISA = qw[ CPANPLUS::Shell::_Base::ReadLine ];
- $VERSION = "0.89_06";
+ $VERSION = "0.89_07";
}
load CPANPLUS::Shell;