r70404 - in /branches/upstream/cpanminus/current: Changes META.yml bin/cpanm lib/App/cpanminus.pm

ghedo-guest at users.alioth.debian.org ghedo-guest at users.alioth.debian.org
Sat Mar 5 10:41:35 UTC 2011


Author: ghedo-guest
Date: Sat Mar  5 10:41:26 2011
New Revision: 70404

URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=70404
Log:
[svn-upgrade] new version cpanminus (1.3001)

Modified:
    branches/upstream/cpanminus/current/Changes
    branches/upstream/cpanminus/current/META.yml
    branches/upstream/cpanminus/current/bin/cpanm
    branches/upstream/cpanminus/current/lib/App/cpanminus.pm

Modified: branches/upstream/cpanminus/current/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/cpanminus/current/Changes?rev=70404&op=diff
==============================================================================
--- branches/upstream/cpanminus/current/Changes (original)
+++ branches/upstream/cpanminus/current/Changes Sat Mar  5 10:41:26 2011
@@ -1,4 +1,19 @@
 See http://github.com/miyagawa/cpanminus/ for the latest development.
+
+1.3001   Thu Mar  3 18:33:56 PST 2011
+   - Documentation overhaul
+   - Fixed a bug -L will install non-core modules again and again for each run
+
+1.3000   Wed Mar  2 14:39:44 PST 2011
+   - No changes since the last beta
+
+1.29_02  Tue Mar  1 16:06:20 PST 2011
+   - Improved the dependencies detection when -L is in use so the core modules that have been upgraded
+     inside can be correctly be detected, using Module::CoreList.
+   - Added a crazy hack to support Build.PL configure dependencies > 0.36 when -L is in effect
+
+1.29_01  Mon Feb 28 18:57:27 PST 2011
+   - Disable --uninstall-shadows by default for perl >= 5.12
 
 1.2001  Wed Feb 16 10:54:21 PST 2011
    - This be official 1.2

Modified: branches/upstream/cpanminus/current/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/cpanminus/current/META.yml?rev=70404&op=diff
==============================================================================
--- branches/upstream/cpanminus/current/META.yml (original)
+++ branches/upstream/cpanminus/current/META.yml Sat Mar  5 10:41:26 2011
@@ -1,6 +1,6 @@
 --- #YAML:1.0
 name:               App-cpanminus
-version:            1.2001
+version:            1.3001
 abstract:           Get, unpack, build and install modules from CPAN.
 author:  []
 license:            perl

Modified: branches/upstream/cpanminus/current/bin/cpanm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/cpanminus/current/bin/cpanm?rev=70404&op=diff
==============================================================================
--- branches/upstream/cpanminus/current/bin/cpanm (original)
+++ branches/upstream/cpanminus/current/bin/cpanm Sat Mar  5 10:41:26 2011
@@ -18,7 +18,7 @@
 
 $fatpacked{"App/cpanminus.pm"} = <<'APP_CPANMINUS';
   package App::cpanminus;
-  our $VERSION = "1.2001";
+  our $VERSION = "1.3001";
   
   =head1 NAME
   
@@ -32,12 +32,18 @@
   
   =head1 DESCRIPTION
   
-  cpanminus is a script to get, unpack, build and install modules from CPAN.
-  
-  Why? It's dependency free, requires zero configuration, and stands
-  alone. When running, it requires only 10MB of RAM.
+  cpanminus is a script to get, unpack, build and install modules from
+  CPAN and does nothing else.
+  
+  It's dependency free (can bootstrap itself), requires zero
+  configuration, and stands alone. When running, it requires only 10MB
+  of RAM.
   
   =head1 INSTALLATION
+  
+  There are several ways to install cpanminus to your system.
+  
+  =head2 Package management system
   
   There are Debian packages, RPMs, FreeBSD ports, and packages for other
   operation systems available. If you want to use the package management system,
@@ -45,26 +51,39 @@
   easy to install C<cpanm> to your system without thinking about where to
   install, and later upgrade.
   
+  =head2 Installing to system perl
+  
   You can also use the latest cpanminus to install cpanminus itself:
   
       curl -L http://cpanmin.us | perl - --sudo App::cpanminus
   
   This will install C<cpanm> to your bin directory like
   C</usr/local/bin> (unless you configured C<INSTALL_BASE> with
-  L<local::lib>), so you might need the C<--sudo> option.
-  
-  Later you can say C<cpanm --self-upgrade --sudo> to upgrade to the
-  latest version.
-  
-  Otherwise,
+  L<local::lib>), so you probably need the C<--sudo> option.
+  
+  =head2 Installing to local perl (perlbrew)
+  
+  If you have perl in your home directory, which is the case if you use
+  tools like L<perlbrew>, you don't need the C<--sudo> option, since
+  you're most likely to have a write permission to the perl's library
+  path. You can just do:
+  
+      curl -L http://cpanmin.us | perl - App::cpanminus
+  
+  to install the C<cpanm> executable to the perl's bin path, like
+  C<~/perl5/perlbrew/bin/cpanm>.
+  
+  =head2 Downloaing the standalone executable
+  
+  You can also copy the standalone executable to whatever location you'd like.
   
       cd ~/bin
       curl -LO http://xrl.us/cpanm
       chmod +x cpanm
       # edit shebang if you don't have /usr/bin/env
   
-  just works, but be sure to grab the new version manually when you
-  upgrade (C<--self-upgrade> might not work).
+  This just works, but be sure to grab the new version manually when you
+  upgrade because C<--self-upgrade> might not work for this.
   
   =head1 DEPENDENCIES
   
@@ -101,11 +120,10 @@
   
   =head2 But why a new client?
   
-  First of all, I have no intention to dis CPAN or CPANPLUS
-  developers. Don't get me wrong. They're great tools I've 
-  used for I<literally> years (you know how many modules I have
-  on CPAN, right?). I really respect their efforts of maintaining the
-  most important tools in the CPAN toolchain ecosystem.
+  First of all, let me be clear that CPAN and CPANPLUS are great tools
+  I've used for I<literally> years (you know how many modules I have on
+  CPAN, right?). I really respect their efforts of maintaining the most
+  important tools in the CPAN toolchain ecosystem.
   
   However, for less experienced users (mostly from outside the Perl community),
   or even really experienced Perl developers who know how to shoot themselves in
@@ -118,24 +136,94 @@
   It queries the CPAN Meta DB site running on Google AppEngine at
   L<http://cpanmetadb.appspot.com/>. The site is updated every hour to reflect
   the latest changes from fast syncing mirrors. The script then also falls back
-  to the site L<http://search.cpan.org/>. I've been talking to and working with
-  with the QA/toolchain people for building a more reliable CPAN DB website.
-  
-  Fetched files are unpacked in C<~/.cpanm>.  You can configure this with
-  the C<PERL_CPANM_HOME> environment variable.
+  to scrape the site L<http://search.cpan.org/>.
+  
+  Fetched files are unpacked in C<~/.cpanm> and automatically cleaned up
+  periodically.  You can configure the location of this with the
+  C<PERL_CPANM_HOME> environment variable.
   
   =head2 Where does this install modules to? Do I need root access?
   
   It installs to wherever ExtUtils::MakeMaker and Module::Build are
-  configured to (via C<PERL_MM_OPT> and C<MODULEBUILDRC>). So if
-  you're using local::lib, then it installs to your local perl5
-  directory. Otherwise it installs to the siteperl directory.
-  
-  cpanminus at a boot time checks whether you have configured local::lib, or have
-  the permission to install modules to the sitelib directory.  If neither, it
-  automatically sets up local::lib compatible installation path in a C<perl5>
-  directory under your home directory. To avoid this, run the script as the root
-  user, with C<--sudo> option or with C<--local-lib> option.
+  configured to (via C<PERL_MM_OPT> and C<PERL_MB_OPT>). So if you're
+  using local::lib, then it installs to your local perl5
+  directory. Otherwise it installs to the site_perl directory that
+  belongs to your perl.
+  
+  cpanminus at a boot time checks whether you have configured
+  local::lib, or have the permission to install modules to the site_perl
+  directory.  If neither, it automatically sets up local::lib compatible
+  installation path in a C<perl5> directory under your home
+  directory. To avoid this, run the script as the root user, with
+  C<--sudo> option or with C<--local-lib> option.
+  
+  =head2 cpanminus can't install the module XYZ. Is it a bug?
+  
+  It is more likely a problem with the distribution itself. cpanminus
+  doesn't support or is known to have issues with distributions like as
+  follows:
+  
+  =over 4
+  
+  =item *
+  
+  Tests that require input from STDIN.
+  
+  =item *
+  
+  Tests that might fail when C<AUTOMATED_TESTING> is enabled.
+  
+  =item *
+  
+  Modules that have invalid numeric values as VERSION (such as C<1.1a>)
+  
+  =back
+  
+  These failures can be reported back to the author of the module so
+  that they can fix it accordingly, rather than me.
+  
+  =head2 Does cpanm support the feature XYZ of L<CPAN> and L<CPANPLUS>?
+  
+  Most likely not. Here are the things that cpanm doesn't do by
+  itself. And it's a feature - you got that from the name I<minus>,
+  right?
+  
+  If you need these features, use L<CPAN>, L<CPANPLUS> or the standalone
+  tools that are mentioned.
+  
+  =over 4
+  
+  =item *
+  
+  Bundle:: module dependencies
+  
+  =item *
+  
+  CPAN testers reporting
+  
+  =item *
+  
+  Building RPM packages from CPAN modules
+  
+  =item *
+  
+  Listing the outdated modules that needs upgrading. See L<cpan-outdated>
+  
+  =item *
+  
+  Uninstalling modules. See L<pm-uninstall>.
+  
+  =item *
+  
+  Showing the changes of the modules you're about to upgrade. See L<cpan-listchanges>
+  
+  =item *
+  
+  Patching CPAN modules with distroprefs.
+  
+  =back
+  
+  See L<cpanm> or C<cpanm -h> to see what cpanminus I<can> do :)
   
   =head1 COPYRIGHT
   
@@ -224,7 +312,7 @@
   use constant WIN32 => $^O eq 'MSWin32';
   use constant SUNOS => $^O eq 'solaris';
   
-  our $VERSION = "1.2001";
+  our $VERSION = "1.3001";
   
   my $quote = WIN32 ? q/"/ : q/'/;
   
@@ -256,7 +344,7 @@
           try_lwp => 1,
           try_wget => 1,
           try_curl => 1,
-          uninstall_shadows => 1,
+          uninstall_shadows => ($] < 5.012),
           skip_installed => 1,
           auto_cleanup => 7, # days
           @_,
@@ -1158,6 +1246,14 @@
           or return 0, undef;
   
       my $version = $meta->version;
+  
+      # When -L is in use, the version loaded from 'perl' library path
+      # might be newer than the version that is shipped with the current perl
+      if ($self->{self_contained} && $self->loaded_from_perl_lib($meta)) {
+          require Module::CoreList;
+          $version = $Module::CoreList::version{$]}{$mod};
+      }
+  
       $self->{local_versions}{$mod} = $version;
   
       if ($self->is_deprecated($meta)){
@@ -1178,6 +1274,11 @@
       };
   
       return unless $deprecated;
+      return $self->loaded_from_perl_lib($meta);
+  }
+  
+  sub loaded_from_perl_lib {
+      my($self, $meta) = @_;
   
       require Config;
       for my $dir (qw(archlibexp privlibexp)) {
@@ -1247,6 +1348,25 @@
       return 1;
   }
   
+  sub _patch_module_build_config_deps {
+      my($self, $config_deps) = @_;
+  
+      # Crazy hack to auto-add Module::Build dependencies into
+      # configure_requires if Module::Build is there, since there's a
+      # possibility where Module::Build is in 'perl' library path while
+      # the dependencies are in 'site' and can't be loaded when -L
+      # (--local-lib-contained) is in effect.
+  
+      my %config_deps = (@{$config_deps});
+      if ($config_deps{"Module::Build"}) {
+          push @{$config_deps}, (
+              'Perl::OSType' => 1,
+              'Module::Metadata' => 1.000002,
+              'version' => 0.87,
+          );
+      }
+  }
+  
   sub build_stuff {
       my($self, $stuff, $dist, $depth) = @_;
   
@@ -1259,6 +1379,9 @@
       push @config_deps, %{$dist->{meta}{configure_requires} || {}};
   
       my $target = $dist->{meta}{name} ? "$dist->{meta}{name}-$dist->{meta}{version}" : $dist->{dir};
+  
+      $self->_patch_module_build_config_deps(\@config_deps)
+          if $self->{self_contained};
   
       $self->install_deps_bailout($target, $dist->{dir}, $depth, @config_deps)
           or return;
@@ -6492,8 +6615,14 @@
 you won't accidentally uninstall dual-life modules from the core
 include path.
 
-Defaults to true, and you can disable that with
-C<--no-uninst-shadows>.
+Defaults to true if your perl version is smaller than 5.12, and you
+can disable that with C<--no-uninst-shadows>.
+
+B<NOTE>: Since version 1.3000 this flag is turned off by default for
+perl newer than 5.12, since with 5.12 @INC contains site_perl directory
+I<before> the perl core library path, and uninstalling shadows is not
+necessary anymore and does more harm by deleting files from the core
+library path.
 
 =item --auto-cleanup
 

Modified: branches/upstream/cpanminus/current/lib/App/cpanminus.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/cpanminus/current/lib/App/cpanminus.pm?rev=70404&op=diff
==============================================================================
--- branches/upstream/cpanminus/current/lib/App/cpanminus.pm (original)
+++ branches/upstream/cpanminus/current/lib/App/cpanminus.pm Sat Mar  5 10:41:26 2011
@@ -1,5 +1,5 @@
 package App::cpanminus;
-our $VERSION = "1.2001";
+our $VERSION = "1.3001";
 
 =head1 NAME
 
@@ -13,12 +13,18 @@
 
 =head1 DESCRIPTION
 
-cpanminus is a script to get, unpack, build and install modules from CPAN.
-
-Why? It's dependency free, requires zero configuration, and stands
-alone. When running, it requires only 10MB of RAM.
+cpanminus is a script to get, unpack, build and install modules from
+CPAN and does nothing else.
+
+It's dependency free (can bootstrap itself), requires zero
+configuration, and stands alone. When running, it requires only 10MB
+of RAM.
 
 =head1 INSTALLATION
+
+There are several ways to install cpanminus to your system.
+
+=head2 Package management system
 
 There are Debian packages, RPMs, FreeBSD ports, and packages for other
 operation systems available. If you want to use the package management system,
@@ -26,26 +32,39 @@
 easy to install C<cpanm> to your system without thinking about where to
 install, and later upgrade.
 
+=head2 Installing to system perl
+
 You can also use the latest cpanminus to install cpanminus itself:
 
     curl -L http://cpanmin.us | perl - --sudo App::cpanminus
 
 This will install C<cpanm> to your bin directory like
 C</usr/local/bin> (unless you configured C<INSTALL_BASE> with
-L<local::lib>), so you might need the C<--sudo> option.
-
-Later you can say C<cpanm --self-upgrade --sudo> to upgrade to the
-latest version.
-
-Otherwise,
+L<local::lib>), so you probably need the C<--sudo> option.
+
+=head2 Installing to local perl (perlbrew)
+
+If you have perl in your home directory, which is the case if you use
+tools like L<perlbrew>, you don't need the C<--sudo> option, since
+you're most likely to have a write permission to the perl's library
+path. You can just do:
+
+    curl -L http://cpanmin.us | perl - App::cpanminus
+
+to install the C<cpanm> executable to the perl's bin path, like
+C<~/perl5/perlbrew/bin/cpanm>.
+
+=head2 Downloaing the standalone executable
+
+You can also copy the standalone executable to whatever location you'd like.
 
     cd ~/bin
     curl -LO http://xrl.us/cpanm
     chmod +x cpanm
     # edit shebang if you don't have /usr/bin/env
 
-just works, but be sure to grab the new version manually when you
-upgrade (C<--self-upgrade> might not work).
+This just works, but be sure to grab the new version manually when you
+upgrade because C<--self-upgrade> might not work for this.
 
 =head1 DEPENDENCIES
 
@@ -82,11 +101,10 @@
 
 =head2 But why a new client?
 
-First of all, I have no intention to dis CPAN or CPANPLUS
-developers. Don't get me wrong. They're great tools I've 
-used for I<literally> years (you know how many modules I have
-on CPAN, right?). I really respect their efforts of maintaining the
-most important tools in the CPAN toolchain ecosystem.
+First of all, let me be clear that CPAN and CPANPLUS are great tools
+I've used for I<literally> years (you know how many modules I have on
+CPAN, right?). I really respect their efforts of maintaining the most
+important tools in the CPAN toolchain ecosystem.
 
 However, for less experienced users (mostly from outside the Perl community),
 or even really experienced Perl developers who know how to shoot themselves in
@@ -99,24 +117,94 @@
 It queries the CPAN Meta DB site running on Google AppEngine at
 L<http://cpanmetadb.appspot.com/>. The site is updated every hour to reflect
 the latest changes from fast syncing mirrors. The script then also falls back
-to the site L<http://search.cpan.org/>. I've been talking to and working with
-with the QA/toolchain people for building a more reliable CPAN DB website.
-
-Fetched files are unpacked in C<~/.cpanm>.  You can configure this with
-the C<PERL_CPANM_HOME> environment variable.
+to scrape the site L<http://search.cpan.org/>.
+
+Fetched files are unpacked in C<~/.cpanm> and automatically cleaned up
+periodically.  You can configure the location of this with the
+C<PERL_CPANM_HOME> environment variable.
 
 =head2 Where does this install modules to? Do I need root access?
 
 It installs to wherever ExtUtils::MakeMaker and Module::Build are
-configured to (via C<PERL_MM_OPT> and C<MODULEBUILDRC>). So if
-you're using local::lib, then it installs to your local perl5
-directory. Otherwise it installs to the siteperl directory.
-
-cpanminus at a boot time checks whether you have configured local::lib, or have
-the permission to install modules to the sitelib directory.  If neither, it
-automatically sets up local::lib compatible installation path in a C<perl5>
-directory under your home directory. To avoid this, run the script as the root
-user, with C<--sudo> option or with C<--local-lib> option.
+configured to (via C<PERL_MM_OPT> and C<PERL_MB_OPT>). So if you're
+using local::lib, then it installs to your local perl5
+directory. Otherwise it installs to the site_perl directory that
+belongs to your perl.
+
+cpanminus at a boot time checks whether you have configured
+local::lib, or have the permission to install modules to the site_perl
+directory.  If neither, it automatically sets up local::lib compatible
+installation path in a C<perl5> directory under your home
+directory. To avoid this, run the script as the root user, with
+C<--sudo> option or with C<--local-lib> option.
+
+=head2 cpanminus can't install the module XYZ. Is it a bug?
+
+It is more likely a problem with the distribution itself. cpanminus
+doesn't support or is known to have issues with distributions like as
+follows:
+
+=over 4
+
+=item *
+
+Tests that require input from STDIN.
+
+=item *
+
+Tests that might fail when C<AUTOMATED_TESTING> is enabled.
+
+=item *
+
+Modules that have invalid numeric values as VERSION (such as C<1.1a>)
+
+=back
+
+These failures can be reported back to the author of the module so
+that they can fix it accordingly, rather than me.
+
+=head2 Does cpanm support the feature XYZ of L<CPAN> and L<CPANPLUS>?
+
+Most likely not. Here are the things that cpanm doesn't do by
+itself. And it's a feature - you got that from the name I<minus>,
+right?
+
+If you need these features, use L<CPAN>, L<CPANPLUS> or the standalone
+tools that are mentioned.
+
+=over 4
+
+=item *
+
+Bundle:: module dependencies
+
+=item *
+
+CPAN testers reporting
+
+=item *
+
+Building RPM packages from CPAN modules
+
+=item *
+
+Listing the outdated modules that needs upgrading. See L<cpan-outdated>
+
+=item *
+
+Uninstalling modules. See L<pm-uninstall>.
+
+=item *
+
+Showing the changes of the modules you're about to upgrade. See L<cpan-listchanges>
+
+=item *
+
+Patching CPAN modules with distroprefs.
+
+=back
+
+See L<cpanm> or C<cpanm -h> to see what cpanminus I<can> do :)
 
 =head1 COPYRIGHT
 




More information about the Pkg-perl-cvs-commits mailing list