This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Update CPANPLUS to CPAN version 0.91
authorChris 'BinGOs' Williams <chris@bingosnet.co.uk>
Sat, 12 Feb 2011 13:06:22 +0000 (13:06 +0000)
committerChris 'BinGOs' Williams <chris@bingosnet.co.uk>
Sat, 12 Feb 2011 13:06:22 +0000 (13:06 +0000)
  [DELTA]

  Changes for 0.91        Fri Feb 11 22:43:31 2011
  ================================================
  * Making a stable release

  Changes for 0.90_13     Mon Feb  7 10:26:35 2011
  ================================================
  * Fix Parse::CPAN::Meta prereq version

  Changes for 0.90_12     Sun Feb  6 19:48:49 2011
  ================================================
  * Remove more trailing whitespace spotted by Nicholas Clark
    with patch to fix, RT #64976
  * Added META.json and MYMETA.json support. Requires a more
    recent Parse::CPAN::Meta
  * Switch to Digest::SHA and SHA256 checksums instead of
    Digest::MD5 and MD5, which has dropped v5.6.x support.

20 files changed:
Porting/Maintainers.pl
cpan/CPANPLUS/lib/CPANPLUS.pm
cpan/CPANPLUS/lib/CPANPLUS/Backend.pm
cpan/CPANPLUS/lib/CPANPLUS/Config.pm
cpan/CPANPLUS/lib/CPANPLUS/Configure.pm
cpan/CPANPLUS/lib/CPANPLUS/Dist.pm
cpan/CPANPLUS/lib/CPANPLUS/Dist/Autobundle.pm
cpan/CPANPLUS/lib/CPANPLUS/Dist/Base.pm
cpan/CPANPLUS/lib/CPANPLUS/Dist/MM.pm
cpan/CPANPLUS/lib/CPANPLUS/Error.pm
cpan/CPANPLUS/lib/CPANPLUS/Internals.pm
cpan/CPANPLUS/lib/CPANPLUS/Internals/Constants.pm
cpan/CPANPLUS/lib/CPANPLUS/Internals/Extract.pm
cpan/CPANPLUS/lib/CPANPLUS/Internals/Utils.pm
cpan/CPANPLUS/lib/CPANPLUS/Module.pm
cpan/CPANPLUS/lib/CPANPLUS/Module/Checksums.pm
cpan/CPANPLUS/lib/CPANPLUS/Selfupdate.pm
cpan/CPANPLUS/lib/CPANPLUS/Shell/Default.pm
cpan/CPANPLUS/lib/CPANPLUS/Shell/Default/Plugins/CustomSource.pm
pod/perldelta.pod

index 7b906a3..b00b751 100755 (executable)
@@ -409,7 +409,7 @@ use File::Glob qw(:case);
     'CPANPLUS' =>
        {
        'MAINTAINER'    => 'kane',
-       'DISTRIBUTION'  => 'BINGOS/CPANPLUS-0.9011.tar.gz',
+       'DISTRIBUTION'  => 'BINGOS/CPANPLUS-0.91.tar.gz',
        'FILES'         => q[cpan/CPANPLUS],
        'EXCLUDED'      => [ qr{^inc/},
                             qr{^t/dummy-.*\.hidden$},
index 0cc1819..d7d4193 100644 (file)
@@ -13,7 +13,7 @@ BEGIN {
     use vars        qw( @EXPORT @ISA $VERSION );
     @EXPORT     =   qw( shell fetch get install );
     @ISA        =   qw( Exporter );
-    $VERSION = "0.9011";     #have to hardcode or cpan.org gets unhappy
+    $VERSION = "0.91";     #have to hardcode or cpan.org gets unhappy
 }
 
 ### purely for backward compatibility, so we can call it from the commandline:
@@ -113,7 +113,7 @@ CPANPLUS - API & CLI access to the CPAN mirrors
     $ perl -MCPANPLUS -eshell
     $ perl -MCPANPLUS -e'fetch Some::Module'
 
-    
+
 =head1 DESCRIPTION
 
 The C<CPANPLUS> library is an API to the C<CPAN> mirrors and a
@@ -160,7 +160,7 @@ the two following commands:
 All commands available are listed in the interactive shells
 help menu. See C<cpanp -h> or L<CPANPLUS::Shell::Default> 
 for instructions on using the default shell.  
-    
+
 =head2 CHOOSE A SHELL
 
 By running C<cpanp> without arguments, you will start up
@@ -173,7 +173,7 @@ the old C<CPAN.pm> shell.
 You can start this shell by typing:
 
     $ perl -MCPANPLUS -e'shell Classic'
-    
+
 Even more shells may be available from C<CPAN>.    
 
 Note that if you have changed your default shell in your
@@ -188,8 +188,8 @@ from C<CPAN> into a package in the format of your choice, like
 for example C<.deb> or C<FreeBSD ports>. 
 
 See C<cpan2dist -h> for details.
-    
-    
+
+
 =head1 FUNCTIONS
 
 For quick access to common commands, you may use this module,
index f7b9b92..43e73b7 100644 (file)
@@ -1239,7 +1239,7 @@ Here's an example of how custom sources would resolve into index files:
   file:///path/to/sources       =>  file:///path/to/sources/packages.txt
   http://example.com/sources    =>  http://example.com/sources/packages.txt
   ftp://example.com/sources     =>  ftp://example.com/sources/packages.txt
-  
+
 The file C<packages.txt> simply holds a list of packages that can be found
 under the root of the C<URI>. This file can be automatically generated for
 you when the remote source is a C<file:// URI>. For C<http://>, C<ftp://>,
index 91e152a..5cf11d3 100644 (file)
@@ -297,14 +297,14 @@ when invoked. Defaults to an empty string.
 
 =item md5
 
-A boolean indicating whether or not md5 checks should be done when
-an archive is fetched. Defaults to 'true' if you have C<Digest::MD5>
+A boolean indicating whether or not sha256 checks should be done when
+an archive is fetched. Defaults to 'true' if you have C<Digest::SHA>
 installed, 'false' otherwise.
 
 =cut
 
         $Conf->{'conf'}->{'md5'} = ( 
-                            check_install( module => 'Digest::MD5' ) ? 1 : 0 );
+                            check_install( module => 'Digest::SHA' ) ? 1 : 0 );
 
 =item no_update
 
@@ -332,6 +332,7 @@ C<Compress::Zlib> installed (as that would mean we could not extract
 C<.tar.gz> files)
 
 =cut
+
         ### if we dont have c::zlib, we'll need to use /bin/tar or we
         ### can not extract any files. Good time to change the default
         $Conf->{'conf'}->{'prefer_bin'} = 
index 232d6d1..ba1ca07 100644 (file)
@@ -70,14 +70,18 @@ This method returns a new object. Normal users will never need to
 invoke the C<new> method, but instead retrieve the desired object via
 a method call on a C<CPANPLUS::Backend> object.
 
+=over 4
+
 =item load_configs
 
 Controls whether or not additional user configurations are to be loaded 
 or not. Defaults to C<true>.
 
+=back
+
 =cut
 
-### store teh CPANPLUS::Config object in a closure, so we only
+### store the CPANPLUS::Config object in a closure, so we only
 ### initialize it once.. otherwise, on a 2nd ->new, settings
 ### from configs on top of this one will be reset
 {   my $Config;
index f0d474f..20c74fc 100644 (file)
@@ -88,18 +88,18 @@ works. This will be set upon a successful create.
 
 =head2 $dist = CPANPLUS::Dist::YOUR_DIST_TYPE_HERE->new( module => MODOBJ );
 
-Create a new C<CPANPLUS::Dist::YOUR_DIST_TYPE_HERE> object based on the 
+Create a new C<CPANPLUS::Dist::YOUR_DIST_TYPE_HERE> object based on the
 provided C<MODOBJ>.
 
 *** DEPRECATED ***
 The optional argument C<format> is used to indicate what type of dist
-you would like to create (like C<CPANPLUS::Dist::MM> or 
+you would like to create (like C<CPANPLUS::Dist::MM> or
 C<CPANPLUS::Dist::Build> and so on ).
 
 C<< CPANPLUS::Dist->new >> is exclusively meant as a method to be
 inherited by C<CPANPLUS::Dist::MM|Build>.
 
-Returns a C<CPANPLUS::Dist::YOUR_DIST_TYPE_HERE> object on success 
+Returns a C<CPANPLUS::Dist::YOUR_DIST_TYPE_HERE> object on success
 and false on failure.
 
 =cut
@@ -114,7 +114,7 @@ sub new {
     my $tmpl = {
         module  => { required => 1, allow => IS_MODOBJ, store => \$mod },
         ### for backwards compatibility
-        format  => { default  => $class, store => \$format, 
+        format  => { default  => $class, store => \$format,
                      allow    => [ __PACKAGE__->dist_types ],
         },
     };
@@ -130,7 +130,7 @@ sub new {
     my $obj = $format->SUPER::new;
 
     $obj->mk_accessors( qw[parent status] );
-    
+
     ### set the parent
     $obj->parent( $mod );
 
@@ -139,7 +139,7 @@ sub new {
         $obj->status($acc);
 
         ### add minimum supported accessors
-        $acc->mk_accessors( qw[prepared created installed uninstalled 
+        $acc->mk_accessors( qw[prepared created installed uninstalled
                                distdir dist] );
     }
 
@@ -178,7 +178,7 @@ Returns a list of the CPANPLUS::Dist::* classes available
 
     ### backdoor method to add more dist types
     sub _add_dist_types     { my $self = shift; push @Dists,  @_ };
-    
+
     ### backdoor method to exclude dist types
     sub _ignore_dist_types  { my $self = shift; push @Ignore, @_ };
     sub _reset_dist_ignore  { @Ignore = () };
@@ -208,8 +208,8 @@ Returns a list of the CPANPLUS::Dist::* classes available
                             require     => 1,
                             except      => [ keys %except ]
                         );
-            my %ignore = map { $_ => $_ } @Ignore;                        
-                        
+            my %ignore = map { $_ => $_ } @Ignore;
+
             push @Dists, grep { not $ignore{$_} and not $except{$_} }
                 __PACKAGE__->_dist_types;
         }
@@ -224,12 +224,12 @@ C<CPANPLUS::Dist::*> classes and want to make them available to the
 current process.
 
 =cut
-    
+
     sub rescan_dist_types {
         my $dist    = shift;
         $Loaded     = 0;    # reset the flag;
         return $dist->dist_types;
-    }        
+    }
 }
 
 =head2 $bool = CPANPLUS::Dist->has_dist_type( $type )
@@ -241,9 +241,9 @@ Returns true if distribution type C<$type> is loaded/supported.
 sub has_dist_type {
     my $dist = shift;
     my $type = shift or return;
-    
+
     return scalar grep { $_ eq $type } CPANPLUS::Dist->dist_types;
-}    
+}
 
 =head2 $bool = $dist->prereq_satisfied( modobj => $modobj, version => $version_spec )
 
@@ -257,26 +257,26 @@ sub prereq_satisfied {
     my $dist = shift;
     my $cb   = $dist->parent->parent;
     my %hash = @_;
-  
+
     my($mod,$ver);
     my $tmpl = {
         version => { required => 1, store => \$ver },
         modobj  => { required => 1, store => \$mod, allow => IS_MODOBJ },
     };
-    
+
     check( $tmpl, \%hash ) or return;
-  
+
     return 1 if $mod->is_uptodate( version => $ver );
-  
+
     if ( $cb->_vcmp( $ver, $mod->version ) > 0 ) {
 
-        error(loc(  
+        error(loc(
                 "This distribution depends on %1, but the latest version".
                 " of %2 on CPAN (%3) doesn't satisfy the specific version".
                 " dependency (%4). You may have to resolve this dependency ".
-                "manually.", 
+                "manually.",
                 $mod->module, $mod->module, $mod->version, $ver ));
-  
+
     }
 
     return;
@@ -284,7 +284,7 @@ sub prereq_satisfied {
 
 =head2 $configure_requires = $dist->find_configure_requires( [file => /path/to/META.yml] )
 
-Reads the configure_requires for this distribution from the META.yml
+Reads the configure_requires for this distribution from the META.yml or META.json
 file in the root directory and returns a hashref with module names
 and versions required.
 
@@ -293,56 +293,112 @@ and versions required.
 sub find_configure_requires {
     my $self = shift;
     my $mod  = $self->parent;
+    my %hash = @_;
+
+    my ($meta);
+    my $href = {};
+
+    my $tmpl = {
+        file => { store => \$meta },
+    };
+
+    check( $tmpl, \%hash ) or return;
+
     my $meth = 'configure_requires';
-    
-    ### the prereqs as we have them now
-    my @args = ( 
+
+    {
+
+      ### the prereqs as we have them now
+      my @args = (
         defaults => $mod->status->$meth || {},
-        keys     => [ $meth ],
-    );
+      );
+
+      my @possibles = do { defined $mod->status->extract 
+                           ? ( META_JSON->( $mod->status->extract ),
+                               META_YML->( $mod->status->extract ) )
+                           : ()
+                      };
+
+      unshift @possibles, $meta if $meta;
+
+      META: foreach my $mfile ( grep { -e } @possibles ) {
+          push @args, ( file => $mfile );
+          if ( $mfile =~ /\.json/ ) {
+            $href = $self->_prereqs_from_meta_json( @args, keys => [ 'configure' ] );
+          }
+          else {
+            $href = $self->_prereqs_from_meta_file( @args, keys => [ $meth ] );
+          }
+          last META;
+      }
 
-    ### the default file to use, which may be overridden
-    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 %hash = @_;
+
+    my ($meta);
+    my $href = {};
+
+    my $tmpl = {
+        file => { store => \$meta },
+    };
+
+    check( $tmpl, \%hash ) or return;
+
     my $meth = 'prereqs';
-    
-    ### the prereqs as we have them now
-    my @args = ( 
+
+    {
+
+      ### the prereqs as we have them now
+      my @args = (
         defaults => $mod->status->$meth || {},
-        keys     => [qw|requires build_requires|],
-    );
+      );
+
+      my @possibles = do { defined $mod->status->extract 
+                           ? ( MYMETA_JSON->( $mod->status->extract ),
+                               MYMETA_YML->( $mod->status->extract ) )
+                           : ()
+                      };
+
+      unshift @possibles, $meta if $meta;
+
+      META: foreach my $mfile ( grep { -e } @possibles ) {
+          push @args, ( file => $mfile );
+          if ( $mfile =~ /\.json/ ) {
+            $href = $self->_prereqs_from_meta_json( @args,
+                keys => [ qw|build test runtime| ] );
+          }
+          else {
+            $href = $self->_prereqs_from_meta_file( @args,
+                keys => [ qw|build_requires requires| ] );
+          }
+          last META;
+      }
 
-    ### the default file to use, which may be overridden
-    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 $mod  = $self->parent;
     my %hash = @_;
 
     my( $meta, $defaults, $keys );
-    my $tmpl = {                ### check if we have an extract path. if not, we 
+    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
                                         ? META_YML->( $mod->status->extract )
@@ -353,17 +409,17 @@ sub _prereqs_from_meta_file {
                          store => \$defaults },
         keys        => { required => 1, default => [], strict_type => 1,
                          store => \$keys },
-    };                
-    
+    };
+
     check( $tmpl, \%hash ) or return;
-    
+
     ### if there's a meta file, we read it;
     if( -e $meta ) {
 
         ### Parse::CPAN::Meta uses exceptions for errors
         ### hash returned in list context!!!
         my ($doc) = eval { Parse::CPAN::Meta::LoadFile( $meta ) };
-  
+
         unless( $doc ) {
             error(loc( "Could not read %1: '%2'", $meta, $@ ));
             return $defaults;
@@ -378,7 +434,61 @@ sub _prereqs_from_meta_file {
             } if $doc->{ $key };
         }
     }
-    
+
+    ### and return a copy
+    return \%{ $defaults };
+}
+
+sub _prereqs_from_meta_json {
+    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
+                                        ? META_JSON->( $mod->status->extract )
+                                        : '' },
+                        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;
+
+    ### if there's a meta file, we read it;
+    if( -e $meta ) {
+
+        ### Parse::CPAN::Meta uses exceptions for errors
+        ### hash returned in list context!!!
+        my ($doc) = eval { Parse::CPAN::Meta->load_file( $meta ) };
+
+        unless( $doc ) {
+            error(loc( "Could not read %1: '%2'", $meta, $@ ));
+            return $defaults;
+        }
+
+        ### read the keys now, make sure not to throw
+        ### away anything that was already added
+        #for my $key ( @$keys ) {
+        #    $defaults = {
+        #        %$defaults,
+        #        %{ $doc->{$key} },
+        #    } if $doc->{ $key };
+        #}
+        my $prereqs = $doc->{prereqs} || {};
+        for my $key ( @$keys ) {
+            $defaults = {
+                %$defaults,
+                %{ $prereqs->{$key}->{requires} },
+            } if $prereqs->{ $key }->{requires};
+        }
+    }
+
     ### and return a copy
     return \%{ $defaults };
 }
@@ -451,7 +561,7 @@ sub _resolve_prereqs {
         PREREQ_IGNORE,  TARGET_IGNORE,
         PREREQ_INSTALL, TARGET_INSTALL,
     }->{ $conf->get_conf('prereqs') } || '';
-    
+
     ### XXX BIG NASTY HACK XXX FIXME at some point.
     ### when installing Bundle::CPANPLUS::Dependencies, we want to
     ### install all packages matching 'cpanplus' to be installed last,
@@ -466,7 +576,7 @@ sub _resolve_prereqs {
     ### we got a transparent implementation.. that would mean we would
     ### just have to remove the 'sort' here, and all will be well
     my @sorted_prereqs;
-    
+
     ### use regex, could either be a module name, or a package name
     if( $self->module =~ /^Bundle(::|-)CPANPLUS(::|-)Dependencies/ ) {
         my (@first, @last);
@@ -483,13 +593,13 @@ sub _resolve_prereqs {
     ### first, transfer this key/value pairing into a
     ### list of module objects + desired versions
     my @install_me;
-    
+
     for my $mod ( @sorted_prereqs ) {
         ( my $version = $prereqs->{$mod} ) =~ s#[^0-9\._]+##g;
-        
+
         ### 'perl' is a special case, there's no mod object for it
         if( $mod eq PERL_CORE ) {
-            
+
             ### run a CLI invocation to see if the perl you specified is
             ### uptodate
             my $ok = run( command => "$^X -M$version -e1", verbose => 0 );
@@ -497,14 +607,14 @@ sub _resolve_prereqs {
             unless( $ok ) {
                 error(loc(  "Module '%1' needs perl version '%2', but you ".
                             "only have version '%3' -- can not proceed",
-                            $self->module, $version, 
+                            $self->module, $version,
                             $cb->_perl_version( perl => $^X ) ) );
-                return;                            
+                return;
             }
 
             next;
         }
-        
+
         my $modobj  = $cb->module_tree($mod);
 
         #### XXX we ignore the version, and just assume that the latest
@@ -520,8 +630,8 @@ sub _resolve_prereqs {
             }
             if ( $cb->_vcmp( $version, $core ) > 0 ) {
                error(loc( "Version of core module '%1' ('%2') is too low for ".
-                          "'%3' (needs '%4') -- carrying on but this may be a problem", 
-                          $mod, $core, 
+                          "'%3' (needs '%4') -- carrying on but this may be a problem",
+                          $mod, $core,
                           $self->module, $version ));
             }
             next;
@@ -583,7 +693,7 @@ sub _resolve_prereqs {
         ### see bug [#11840]
         ### if either force or prereq_build are given, the prereq
         ### should be built anyway
-        next if (!$force and !$prereq_build) && 
+        next if (!$force and !$prereq_build) &&
                 $dist->prereq_satisfied(modobj => $modobj, version => $version);
 
         ### either we're told to ignore the prereq,
@@ -663,7 +773,7 @@ sub _resolve_prereqs {
                                      "-- weird", $modobj->module));
 
             $modobj->add_to_includepath();
-            
+
             next;
         }
     }
index 16638b2..9561dd9 100644 (file)
@@ -16,7 +16,7 @@ CPANPLUS::Dist::Autobundle
 
     $modobj = $cb->parse_module( module => 'file://path/to/Snapshot_XXYY.pm' );
     $modobj->install;
-    
+
 =head1 DESCRIPTION
 
 C<CPANPLUS::Dist::Autobundle> is a distribution class for installing installation
index c8bd824..904ab17 100644 (file)
@@ -97,14 +97,14 @@ For example, you might want to add extra accessors to the C<status>
 object, which you might do as follows:
 
     $dist->status->mk_accessors( qw[my_implementation_accessor] );
-    
+
 The C<status> object is implemented as an instance of the 
 C<Object::Accessor> class. Please refer to its documentation for 
 details.
-    
+
 Return true if the initialization was successful, and false if it was
 not.
-    
+
 The C<CPANPLUS::Dist::Base> implementation does not alter your object 
 and always returns true.
 
index 79f537a..b2205e4 100644 (file)
@@ -32,7 +32,7 @@ CPANPLUS::Dist::MM
     $mm->create;        # runs make && make test
     $mm->install;       # runs make install
 
-    
+
 =head1 DESCRIPTION
 
 C<CPANPLUS::Dist::MM> is a distribution class for MakeMaker related
@@ -154,7 +154,9 @@ sub format_available {
     return 1;     
 }
 
-=pod $bool = $dist->init();
+=pod
+
+=head2 $bool = $dist->init();
 
 Sets up the C<CPANPLUS::Dist::MM> object for use. 
 Effectively creates all the needed status accessors.
@@ -174,7 +176,9 @@ sub init {
     return 1;
 }    
 
-=pod $bool = $dist->prepare([perl => '/path/to/perl', makemakerflags => 'EXTRA=FLAGS', force => BOOL, verbose => BOOL])
+=pod
+
+=head2 $bool = $dist->prepare([perl => '/path/to/perl', makemakerflags => 'EXTRA=FLAGS', force => BOOL, verbose => BOOL])
 
 C<prepare> preps a distribution for installation. This means it will 
 run C<perl Makefile.PL> and determine what prerequisites this distribution
index 42e26aa..c42435f 100644 (file)
@@ -135,7 +135,10 @@ printed. This defaults to C<*STDERR>.
 This is the filehandle all the messages sent to C<msg()> are being
 printed. This default to C<*STDOUT>.
 
+=back
+
 =cut
+
 local $| = 1;
 $ERROR_FH   = \*STDERR;
 $MSG_FH     = \*STDOUT;
index 127a053..b58baf9 100644 (file)
@@ -42,7 +42,7 @@ use vars qw[@ISA $VERSION];
             CPANPLUS::Internals::Report
         ];
 
-$VERSION = "0.9011";
+$VERSION = "0.91";
 
 =pod
 
@@ -104,6 +104,7 @@ You have to pass it a valid C<CPANPLUS::Configure> object.
 Returns the object on success, or dies on failure.
 
 =cut
+
 {   ### NOTE:
     ### if extra callbacks are added, don't forget to update the
     ### 02-internals.t test script with them!
index 1a38200..443d5a4 100644 (file)
@@ -154,6 +154,16 @@ use constant MYMETA_YML     => sub { return @_
                                         : 'MYMETA.yml';
                             }; 
 
+use constant META_JSON       => sub { return @_
+                                        ? File::Spec->catfile( @_, 'META.json' )
+                                        : 'META.json';
+                            };
+
+use constant MYMETA_JSON     => sub { return @_
+                                        ? File::Spec->catfile( @_, 'MYMETA.json' )
+                                        : 'MYMETA.json';
+                            };
+
 use constant BLIB           => sub { return @_
                                         ? File::Spec->catfile(@_, 'blib')
                                         : 'blib';
index b839a75..f30911b 100644 (file)
@@ -36,12 +36,12 @@ CPANPLUS::Internals::Extract extracts compressed files for CPANPLUS.
 It can do this by either a pure perl solution (preferred) with the 
 use of C<Archive::Tar> and C<Compress::Zlib>, or with binaries, like
 C<gzip> and C<tar>.
+
 The flow looks like this:
 
     $cb->_extract
         Delegate to Archive::Extract
+
 =head1 METHODS
 
 =head2 $dir = _extract( module => $modobj, [perl => '/path/to/perl', extractdir => '/path/to/extract/to', prefer_bin => BOOL, verbose => BOOL, force => BOOL] )
index 8475c36..31abaff 100644 (file)
@@ -238,7 +238,9 @@ sub _get_file_contents {
     return $contents;
 }
 
-=pod $cb->_move( from => $file|$dir, to => $target );
+=pod
+
+=head2 $cb->_move( from => $file|$dir, to => $target );
 
 Moves a file or directory to the target.
 
@@ -267,7 +269,9 @@ sub _move {
     }
 }
 
-=pod $cb->_copy( from => $file|$dir, to => $target );
+=pod
+
+=head2 $cb->_copy( from => $file|$dir, to => $target );
 
 Moves a file or directory to the target.
 
index efeb4b2..8d237ef 100644 (file)
@@ -833,7 +833,7 @@ sub dist {
 =pod
 
 =head2 $bool = $mod->prepare( )
+
 Convenience method around C<install()> that prepares a module 
 without actually building it. This is equivalent to invoking C<install>
 with C<target> set to C<prepare>
index e1a2bbd..3f9561e 100644 (file)
@@ -75,7 +75,7 @@ sub _validate_checksum {
 
     ### if we can't check it, we must assume it's ok ###
     return $self->status->checksum_ok(1)
-            unless can_load( modules => { 'Digest::MD5' => '0.0' } );
+            unless can_load( modules => { 'Digest::SHA' => '0.0' } );
     #class CPANPLUS::Module::Status is runtime-generated
 
     my $file = $self->_get_checksums_file( verbose => $verbose ) or (
@@ -103,29 +103,30 @@ sub _validate_checksum {
         msg(loc("Archive size is not known for '%1'",$self->package),$verbose);
     }
     
-    my $md5 = $href->{ $self->package }->{'md5'};
+    my $sha = $href->{ $self->package }->{'sha256'};
 
-    unless( defined $md5 ) {
-        msg(loc("No 'md5' checksum known for '%1'",$self->package),$verbose);
+    unless( defined $sha ) {
+        msg(loc("No 'sha256' checksum known for '%1'",$self->package),$verbose);
 
         return $self->status->checksum_ok(1);
     }
 
-    $self->status->checksum_value($md5);
+    $self->status->checksum_value($sha);
 
 
     my $fh = FileHandle->new( $self->status->fetch ) or return;
     binmode $fh;
 
-    my $ctx = Digest::MD5->new;
+    my $ctx = Digest::SHA->new(256);
     $ctx->addfile( $fh );
 
-    my $flag = $ctx->hexdigest eq $md5;
+    my $hexdigest = $ctx->hexdigest;
+    my $flag = $hexdigest eq $sha;
     $flag
         ? msg(loc("Checksum matches for '%1'", $self->package),$verbose)
         : error(loc("Checksum does not match for '%1': " .
-                    "MD5 is '%2' but should be '%3'",
-                    $self->package, $ctx->hexdigest, $md5),$verbose);
+                    "SHA256 is '%2' but should be '%3'",
+                    $self->package, $hexdigest, $sha),$verbose);
 
 
     return $self->status->checksum_ok(1) if $flag;
index 0118e43..6f2015c 100644 (file)
@@ -66,7 +66,7 @@ CPANPLUS::Selfupdate
             'Module::CoreList'          => '2.22', # deprecated core modules
             'Module::Pluggable'         => '2.4',
             'Module::Loaded'            => '0.01',
-            'Parse::CPAN::Meta'         => '0.02', # config_requires support
+            'Parse::CPAN::Meta'         => '1.4200', # config_requires support
             'ExtUtils::Install'         => '1.42', # uninstall outside @INC
             ( check_install( module => 'CPANPLUS::Dist::Build' ) 
               ? ( 'CPANPLUS::Dist::Build' => '0.24' ) : () ),
@@ -88,7 +88,7 @@ CPANPLUS::Selfupdate
             ],            
             cpantest        => [
                 { 'Test::Reporter'  => '1.34',
-                  'Parse::CPAN::Meta' => '0.0'
+                  'Parse::CPAN::Meta' => '1.4200'
                 },
                 sub { 
                     my $cb = shift;
@@ -110,7 +110,7 @@ CPANPLUS::Selfupdate
 
             md5 => [
                 {
-                    'Digest::MD5'   => '0.0',
+                    'Digest::SHA'   => '0.0',
                 },            
                 sub { 
                     my $cb = shift;
@@ -236,7 +236,7 @@ See C<selfupdate> for details.
     sub list_categories { return sort keys %$cache }
 
 =head2 %list = $self->list_modules_to_update( update => "core|dependencies|enabled_features|features|all", [latest => BOOL] )
-    
+
 List which modules C<selfupdate> would upgrade. You can update either 
 the core (CPANPLUS itself), the core dependencies, all features you have
 currently turned on, or all features available, or everything.
@@ -249,11 +249,11 @@ Returns a hash of feature names and lists of module objects to be
 upgraded based on the category you provided. For example:
 
     %list = $self->list_modules_to_update( update => 'core' );
-    
+
 Would return:
 
     ( core => [ $module_object_for_cpanplus ] );
-    
+
 =cut    
     
     sub list_modules_to_update {
@@ -290,7 +290,7 @@ Would return:
         
         return %list;
     }
-    
+
 =head2 $bool = $self->selfupdate( update => "core|dependencies|enabled_features|features|all", [latest => BOOL, force => BOOL] )
 
 Selfupdate CPANPLUS. You can update either the core (CPANPLUS itself),
index 187285e..71ed154 100644 (file)
@@ -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.9011";
+    $VERSION = "0.91";
 }
 
 load CPANPLUS::Shell;
index ad4701a..7b54681 100644 (file)
@@ -12,7 +12,7 @@ use Locale::Maketext::Simple        Class => 'CPANPLUS', Style => 'gettext';
 CPANPLUS::Shell::Default::Plugins::CustomSource 
 
 =head1 SYNOPSIS
-    
+
     ### elaborate help text
     CPAN Terminal> /? cs
 
index b92dcc3..a205da1 100644 (file)
@@ -132,6 +132,13 @@ C<CGI> has been upgraded from version 3.51 to 3.52
 
 =item *
 
+C<CPANPLUS> has been upgraded from version 0.9011 to 0.91
+
+Includes support for META.json and MYMETA.json and a change to
+using Digest::SHA for CPAN checksums.
+
+=item *
+
 C<IPC::Cmd> has been upgraded from version 0.68 to 0.70
 
 =item *