r74642 - in /branches/upstream/perlbrew/current: ./ bin/ inc/Module/ inc/Module/Install/ lib/App/ t/

ghedo-guest at users.alioth.debian.org ghedo-guest at users.alioth.debian.org
Tue May 17 15:44:27 UTC 2011


Author: ghedo-guest
Date: Tue May 17 15:44:16 2011
New Revision: 74642

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

Added:
    branches/upstream/perlbrew/current/t/06.installed_perls.t
Modified:
    branches/upstream/perlbrew/current/Changes
    branches/upstream/perlbrew/current/MANIFEST
    branches/upstream/perlbrew/current/META.yml
    branches/upstream/perlbrew/current/README
    branches/upstream/perlbrew/current/bin/perlbrew
    branches/upstream/perlbrew/current/inc/Module/Install.pm
    branches/upstream/perlbrew/current/inc/Module/Install/Base.pm
    branches/upstream/perlbrew/current/inc/Module/Install/Can.pm
    branches/upstream/perlbrew/current/inc/Module/Install/Fetch.pm
    branches/upstream/perlbrew/current/inc/Module/Install/Makefile.pm
    branches/upstream/perlbrew/current/inc/Module/Install/Metadata.pm
    branches/upstream/perlbrew/current/inc/Module/Install/Scripts.pm
    branches/upstream/perlbrew/current/inc/Module/Install/Win32.pm
    branches/upstream/perlbrew/current/inc/Module/Install/WriteAll.pm
    branches/upstream/perlbrew/current/lib/App/perlbrew.pm
    branches/upstream/perlbrew/current/t/05.get_current_perl.t

Modified: branches/upstream/perlbrew/current/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/perlbrew/current/Changes?rev=74642&op=diff
==============================================================================
--- branches/upstream/perlbrew/current/Changes (original)
+++ branches/upstream/perlbrew/current/Changes Tue May 17 15:44:16 2011
@@ -1,3 +1,11 @@
+0.21:
+- oylenshpeegul++ Let version numbers alone mean installation names. For example, 5.12.3 means perl-5.12.3
+- audreyt++ fixed `perlbrew install <URL>` that might installs to a wrong path.
+- Fix RT #68241
+- Improve `perlbrew list` command output
+- Improve `perlbrew install` command. Now it takes a local .tar.gz filename
+- See more detail in http://perlbrew.pl/Release-0.21.html
+
 0.20:
 - For more detail release note, see https://github.com/gugod/App-perlbrew/wiki/Relesae-0.20
 - doherty++ FIX: stop when user specified an invalid perl version that cannot be found on cpan.

Modified: branches/upstream/perlbrew/current/MANIFEST
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/perlbrew/current/MANIFEST?rev=74642&op=diff
==============================================================================
--- branches/upstream/perlbrew/current/MANIFEST (original)
+++ branches/upstream/perlbrew/current/MANIFEST Tue May 17 15:44:16 2011
@@ -25,3 +25,4 @@
 t/04.find_available_perls.t
 t/04.test_uniq.t
 t/05.get_current_perl.t
+t/06.installed_perls.t

Modified: branches/upstream/perlbrew/current/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/perlbrew/current/META.yml?rev=74642&op=diff
==============================================================================
--- branches/upstream/perlbrew/current/META.yml (original)
+++ branches/upstream/perlbrew/current/META.yml Tue May 17 15:44:16 2011
@@ -10,7 +10,7 @@
 configure_requires:
   ExtUtils::MakeMaker: 6.42
 distribution_type: module
-generated_by: 'Module::Install version 1.00'
+generated_by: 'Module::Install version 1.01'
 license: mit
 meta-spec:
   url: http://module-build.sourceforge.net/META-spec-v1.4.html
@@ -28,4 +28,4 @@
 resources:
   license: http://opensource.org/licenses/mit-license.php
   repository: git://github.com/gugod/App-perlbrew.git
-version: 0.20
+version: 0.21

Modified: branches/upstream/perlbrew/current/README
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/perlbrew/current/README?rev=74642&op=diff
==============================================================================
--- branches/upstream/perlbrew/current/README (original)
+++ branches/upstream/perlbrew/current/README Tue May 17 15:44:16 2011
@@ -5,11 +5,14 @@
         # Initialize
         perlbrew init
 
-        # pick a prefered CPAN mirror
+        # Pick a preferred CPAN mirror
         perlbrew mirror
 
+        # See what is available
+        perlbrew available
+
         # Install some Perls
-        perlbrew install perl-5.12.2
+        perlbrew install 5.14.0
         perlbrew install perl-5.8.1
         perlbrew install perl-5.13.6
 
@@ -20,8 +23,8 @@
         perlbrew switch perl-5.12.2
         perl -v
 
-        # Switch to another version
-        perlbrew switch perl-5.8.1
+        # Temporarily use another version only in current shell.
+        perlbrew use perl-5.8.1
         perl -v
 
         # Switch to a certain perl executable not managed by perlbrew.
@@ -32,6 +35,9 @@
 
         # Use 'switch' command to turn it back on.
         perlbrew switch perl-5.12.2
+
+        # Exec something with all perlbrew-ed perls
+        perlbrew exec perl -E 'say $]'
 
 DESCRIPTION
     perlbrew is a program to automate the building and installation of perl
@@ -49,55 +55,46 @@
     The recommended way to install perlbrew is to run these statements in
     your shell:
 
-        curl -LO http://xrl.us/perlbrew
-        chmod +x perlbrew
-        ./perlbrew install
-
-    or more simply:
-
         curl -L http://xrl.us/perlbrewinstall | bash
 
     After that, "perlbrew" installs itself to "~/perl5/perlbrew/bin", and
     you should follow the instruction on screen to setup your ".bashrc" or
     ".cshrc" to put it in your PATH.
 
+    The downloaded perlbrew is a self-contained standalone program that
+    embeds all non-core modules it uses. It should be runnable with perl 5.8
+    or later versions of perl.
+
+    This installer also installs a packed version of "patchperl" to
+    "~/perl5/perlbrew/bin", which is required to build old perls.
+
     The directory "~/perl5/perlbrew" will contain all install perl
     executables, libraries, documentations, lib, site_libs. If you need to
     install "perlbrew", and the perls it brews, into somewhere else because,
     say, your HOME has limited quota, you can do that by setting a
-    "PERLBREW_ROOT" environment variable before you run "./perlbrew
-    install".
+    "PERLBREW_ROOT" environment variable before running the installer:
 
-        export PERLBREW_ROOT=/mnt/perlbrew
-        ./perlbrew install
+        export PERLBREW_ROOT=/opt/perlbrew
+        curl -L http://xrl.us/perlbrewinstall | bash
 
-    The downloaded perlbrew is a self-contained standalone program that
-    embeds all non-core modules it uses. It should be runnable with perl 5.8
-    or later versions of perl.
-
-    You may also install perlbrew from CPAN with cpan / cpanp / cpanm:
+    You may also install perlbrew from CPAN:
 
         cpan App::perlbrew
 
-    This installs 'perlbrew' into your current PATH and it is always
-    executed with your current perl.
+    However, please make sure not to run this with one of the perls brewed
+    with perlbrew. It's the best to turn perlbrew off before you run that,
+    if you're upgrading.
 
-    NOTICE. When you install or upgrade perlbrew with cpan / cpanp / cpanm,
-    make sure you are not using one of the perls brewed with perlbrew. If
-    so, the `perlbrew` executable you just installed will not be available
-    after you switch to other perls. You might not be able to invoke further
-    "perlbrew" commands after so because the executable "perlbrew" is not in
-    your "PATH" anymore. Installing it again with cpan can temporarily solve
-    this problem. To ensure you are not using a perlbrewed perl, run
-    "perlbrew off" before upgrading.
+        perlbrew off
+        cpan App::perlbrew
 
-    It should be relatively safe to install "App::perlbrew" with system cpan
-    (like "/usr/bin/cpan") because then it will be installed under a system
-    PATH like "/usr/bin", which is not affected by "perlbrew switch"
+    You should always use system cpan (like /usr/bin/cpan) to install
+    "App::perlbrew" because then it will be installed under a system PATH
+    like "/usr/bin", which is not affected by perlbrew "switch" or "use"
     command.
 
-    Again, it is recommended to let "perlbrew" install itself. It's easier,
-    and it works better.
+    However, it is still recommended to let "perlbrew" install itself. It's
+    easier, and it works better.
 
 USAGE
     Please read the program usage by running
@@ -109,28 +106,23 @@
         perlbrew -h
 
 PROJECT DEVELOPMENT
-    perlbrew project uses PivotalTracker for task tracking:
-    <http://www.pivotaltracker.com/projects/129997>. You may also report
-    bugs to github <http://github.com/gugod/App-perlbrew/issues> or RT
-    <https://rt.cpan.org/Dist/Display.html?Queue=App-perlbrew>. They will be
-    definitely reviewed and handled.
+    perlbrew project uses github
+    <http://github.com/gugod/App-perlbrew/issues> and RT
+    <https://rt.cpan.org/Dist/Display.html?Queue=App-perlbrew> for issue
+    tracking. Issues sent to these two systems will eventually be reviewed
+    and handled.
 
 AUTHOR
     Kang-min Liu "<gugod at gugod.org>"
 
 COPYRIGHT
-    Copyright (c) 2010, Kang-min Liu "<gugod at gugod.org>".
+    Copyright (c) 2010, 2011 Kang-min Liu "<gugod at gugod.org>".
 
 LICENCE
     The MIT License
 
 CONTRIBUTORS
-    Patches and code improvements have been contributed by:
-
-    Tatsuhiko Miyagawa, Chris Prather, Yanick Champoux, aero, Jason May,
-    Jesse Leuhrs, Andrew Rodland, Justin Davis, Masayoshi Sekimura,
-    castaway, jrockway, chromatic, Goro Fuji, Sawyer X, Danijel Tasov,
-    polettix, and tokuhirom.
+    See <https://github.com/gugod/App-perlbrew/contributors>
 
 DISCLAIMER OF WARRANTY
     BECAUSE THIS SOFTWARE IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY

Modified: branches/upstream/perlbrew/current/bin/perlbrew
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/perlbrew/current/bin/perlbrew?rev=74642&op=diff
==============================================================================
--- branches/upstream/perlbrew/current/bin/perlbrew (original)
+++ branches/upstream/perlbrew/current/bin/perlbrew Tue May 17 15:44:16 2011
@@ -29,13 +29,13 @@
         help           Read more detailed instructions
 
     Examples:
-        perlbrew install perl-5.12.3
-        perlbrew install perl-5.13.6
+        perlbrew install perl-5.14.0
+        perlbrew install 5.12.3
 
         perlbrew list
 
-        perlbrew use perl-5.13.6
-        perlbrew switch perl-5.12.3
+        perlbrew use perl-5.12.3
+        perlbrew switch perl-5.14.0
 
         perlbrew switch /path/to/special/perl
         perlbrew switch /path/to/special/perl special-perl
@@ -55,13 +55,15 @@
 
 =item B<install> perl-<version-number>
 
+=item B<install> <version-number>
+
 Build and install the given version of perl.
 
-Version numbers are usually looks like "5.x.xx", or
+Version numbers usually look like "5.x.xx", or
 "perl-5.xx.x-RCx" for release candidates.
 
-The specified perl is downloaded from the cpan webisite, unless mirror
-setting presents.
+The specified perl is downloaded from the CPAN website, unless mirror
+setting are present.
 
 
 =item B<install> perl-blead
@@ -74,17 +76,21 @@
 
     http://perl5.git.perl.org/perl.git/snapshot/blead.tar.gz
 
-This command does not consult mirror setting.
+This command does not consult mirror settings.
 
 
 =item B<install> /path/to/perl/git/checkout/dir
 
 Build and install from the given git checkout dir.
 
+=item B<install> /path/to/perl-5.14.0.tar.gz
+
+Build and install from the given archive file.
 
 =item B<install> http://example.com/mirror/perl-5.12.3.tar.gz
 
-Build and install from the given URL.
+Build and install from the given URL. Supported URL schemes are C<http://>,
+C<https://>, C<ftp://> and C<file://>.
 
 =item B<mirror>
 
@@ -100,6 +106,8 @@
 
 =item B<use> [perl-<version>]
 
+=item B<use> [<version>]
+
 Switch to the given version of perl only in the current shell. This
 will not effect newly opened shells.
 
@@ -111,6 +119,8 @@
 
 =item B<switch> [perl-<version>]
 
+=item B<switch> [<version>]
+
 Switch to the given version, and makes it the default for this and all
 future terminal sessions.
 
@@ -121,6 +131,32 @@
 
 Disable perlbrew. Use C<switch> command to re-enable it.
 
+
+=item B<exec> command
+
+Execute command for all perls.
+
+For example, run a Hello program:
+
+    perlbrew exec perl -e 'print "Hello from $]\n"'
+
+Depending on your actual installations, the output might look like this:
+
+    perl-5.12.2
+    ==========
+    Hello word from perl-5.012002
+    
+    perl-5.12.3
+    ==========
+    Hello word from perl-5.012003
+    
+    perl-5.13.10
+    ==========
+    Hello word from perl-5.013010
+    
+    perl-5.14.0
+    ==========
+    Hello word from perl-5.014000
 
 =item B<env> [perl-version]
 
@@ -140,9 +176,10 @@
 =item B<symlink_executables> <perl-version>
 
 Low-level command. Use this command to create the C<perl> executable
-symbolic link to C<perl5.13.6>.
-
-You don't need to do this unless you were using old perlbrew to
+symbolic link to , say, C<perl5.13.6>. This is only useful
+for development version of perls.
+
+You don't need to do this unless you have been using old perlbrew to
 install perls. The installation layout is changed since version 0.11.
 
 If you just upgraded perlbrew and found C<perlbrew switch> failed to work
@@ -162,7 +199,7 @@
 
 =item B<version>
 
-Show the version of perbrew.
+Show the version of perlbrew.
 
 
 =back
@@ -196,7 +233,7 @@
 
 =item B<-v| --verbose>
 
-Log output to STDOUT rather than a logfile.
+Log output to STDOUT rather than a log file.
 
 =item B<--as>
 

Modified: branches/upstream/perlbrew/current/inc/Module/Install.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/perlbrew/current/inc/Module/Install.pm?rev=74642&op=diff
==============================================================================
--- branches/upstream/perlbrew/current/inc/Module/Install.pm (original)
+++ branches/upstream/perlbrew/current/inc/Module/Install.pm Tue May 17 15:44:16 2011
@@ -31,7 +31,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 = '1.00';
+	$VERSION = '1.01';
 
 	# Storage for the pseudo-singleton
 	$MAIN    = undef;
@@ -467,4 +467,4 @@
 
 1;
 
-# Copyright 2008 - 2010 Adam Kennedy.
+# Copyright 2008 - 2011 Adam Kennedy.

Modified: branches/upstream/perlbrew/current/inc/Module/Install/Base.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/perlbrew/current/inc/Module/Install/Base.pm?rev=74642&op=diff
==============================================================================
--- branches/upstream/perlbrew/current/inc/Module/Install/Base.pm (original)
+++ branches/upstream/perlbrew/current/inc/Module/Install/Base.pm Tue May 17 15:44:16 2011
@@ -4,7 +4,7 @@
 use strict 'vars';
 use vars qw{$VERSION};
 BEGIN {
-	$VERSION = '1.00';
+	$VERSION = '1.01';
 }
 
 # Suspend handler for "redefined" warnings

Modified: branches/upstream/perlbrew/current/inc/Module/Install/Can.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/perlbrew/current/inc/Module/Install/Can.pm?rev=74642&op=diff
==============================================================================
--- branches/upstream/perlbrew/current/inc/Module/Install/Can.pm (original)
+++ branches/upstream/perlbrew/current/inc/Module/Install/Can.pm Tue May 17 15:44:16 2011
@@ -9,7 +9,7 @@
 
 use vars qw{$VERSION @ISA $ISCORE};
 BEGIN {
-	$VERSION = '1.00';
+	$VERSION = '1.01';
 	@ISA     = 'Module::Install::Base';
 	$ISCORE  = 1;
 }

Modified: branches/upstream/perlbrew/current/inc/Module/Install/Fetch.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/perlbrew/current/inc/Module/Install/Fetch.pm?rev=74642&op=diff
==============================================================================
--- branches/upstream/perlbrew/current/inc/Module/Install/Fetch.pm (original)
+++ branches/upstream/perlbrew/current/inc/Module/Install/Fetch.pm Tue May 17 15:44:16 2011
@@ -6,7 +6,7 @@
 
 use vars qw{$VERSION @ISA $ISCORE};
 BEGIN {
-	$VERSION = '1.00';
+	$VERSION = '1.01';
 	@ISA     = 'Module::Install::Base';
 	$ISCORE  = 1;
 }

Modified: branches/upstream/perlbrew/current/inc/Module/Install/Makefile.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/perlbrew/current/inc/Module/Install/Makefile.pm?rev=74642&op=diff
==============================================================================
--- branches/upstream/perlbrew/current/inc/Module/Install/Makefile.pm (original)
+++ branches/upstream/perlbrew/current/inc/Module/Install/Makefile.pm Tue May 17 15:44:16 2011
@@ -8,7 +8,7 @@
 
 use vars qw{$VERSION @ISA $ISCORE};
 BEGIN {
-	$VERSION = '1.00';
+	$VERSION = '1.01';
 	@ISA     = 'Module::Install::Base';
 	$ISCORE  = 1;
 }

Modified: branches/upstream/perlbrew/current/inc/Module/Install/Metadata.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/perlbrew/current/inc/Module/Install/Metadata.pm?rev=74642&op=diff
==============================================================================
--- branches/upstream/perlbrew/current/inc/Module/Install/Metadata.pm (original)
+++ branches/upstream/perlbrew/current/inc/Module/Install/Metadata.pm Tue May 17 15:44:16 2011
@@ -6,7 +6,7 @@
 
 use vars qw{$VERSION @ISA $ISCORE};
 BEGIN {
-	$VERSION = '1.00';
+	$VERSION = '1.01';
 	@ISA     = 'Module::Install::Base';
 	$ISCORE  = 1;
 }
@@ -515,6 +515,7 @@
 		'GNU Free Documentation license'     => 'unrestricted', 1,
 		'GNU Affero General Public License'  => 'open_source',  1,
 		'(?:Free)?BSD license'               => 'bsd',          1,
+		'Artistic license 2\.0'              => 'artistic_2',   1,
 		'Artistic license'                   => 'artistic',     1,
 		'Apache (?:Software )?license'       => 'apache',       1,
 		'GPL'                                => 'gpl',          1,
@@ -550,9 +551,9 @@
 
 sub _extract_bugtracker {
 	my @links   = $_[0] =~ m#L<(
-	 \Qhttp://rt.cpan.org/\E[^>]+|
-	 \Qhttp://github.com/\E[\w_]+/[\w_]+/issues|
-	 \Qhttp://code.google.com/p/\E[\w_\-]+/issues/list
+	 https?\Q://rt.cpan.org/\E[^>]+|
+	 https?\Q://github.com/\E[\w_]+/[\w_]+/issues|
+	 https?\Q://code.google.com/p/\E[\w_\-]+/issues/list
 	 )>#gx;
 	my %links;
 	@links{@links}=();

Modified: branches/upstream/perlbrew/current/inc/Module/Install/Scripts.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/perlbrew/current/inc/Module/Install/Scripts.pm?rev=74642&op=diff
==============================================================================
--- branches/upstream/perlbrew/current/inc/Module/Install/Scripts.pm (original)
+++ branches/upstream/perlbrew/current/inc/Module/Install/Scripts.pm Tue May 17 15:44:16 2011
@@ -6,7 +6,7 @@
 
 use vars qw{$VERSION @ISA $ISCORE};
 BEGIN {
-	$VERSION = '1.00';
+	$VERSION = '1.01';
 	@ISA     = 'Module::Install::Base';
 	$ISCORE  = 1;
 }

Modified: branches/upstream/perlbrew/current/inc/Module/Install/Win32.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/perlbrew/current/inc/Module/Install/Win32.pm?rev=74642&op=diff
==============================================================================
--- branches/upstream/perlbrew/current/inc/Module/Install/Win32.pm (original)
+++ branches/upstream/perlbrew/current/inc/Module/Install/Win32.pm Tue May 17 15:44:16 2011
@@ -6,7 +6,7 @@
 
 use vars qw{$VERSION @ISA $ISCORE};
 BEGIN {
-	$VERSION = '1.00';
+	$VERSION = '1.01';
 	@ISA     = 'Module::Install::Base';
 	$ISCORE  = 1;
 }

Modified: branches/upstream/perlbrew/current/inc/Module/Install/WriteAll.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/perlbrew/current/inc/Module/Install/WriteAll.pm?rev=74642&op=diff
==============================================================================
--- branches/upstream/perlbrew/current/inc/Module/Install/WriteAll.pm (original)
+++ branches/upstream/perlbrew/current/inc/Module/Install/WriteAll.pm Tue May 17 15:44:16 2011
@@ -6,7 +6,7 @@
 
 use vars qw{$VERSION @ISA $ISCORE};
 BEGIN {
-	$VERSION = '1.00';
+	$VERSION = '1.01';
 	@ISA     = qw{Module::Install::Base};
 	$ISCORE  = 1;
 }

Modified: branches/upstream/perlbrew/current/lib/App/perlbrew.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/perlbrew/current/lib/App/perlbrew.pm?rev=74642&op=diff
==============================================================================
--- branches/upstream/perlbrew/current/lib/App/perlbrew.pm (original)
+++ branches/upstream/perlbrew/current/lib/App/perlbrew.pm Tue May 17 15:44:16 2011
@@ -5,7 +5,7 @@
 use Getopt::Long ();
 use File::Spec::Functions qw( catfile );
 
-our $VERSION = "0.20";
+our $VERSION = "0.21";
 our $CONF;
 
 my $ROOT         = $ENV{PERLBREW_ROOT} || "$ENV{HOME}/perl5/perlbrew";
@@ -60,8 +60,10 @@
                     echo "Using $PERLBREW_PERL version"
                 fi
             elif [[ -x "$PERLBREW_ROOT/perls/$2/bin/perl" || "$2" = "system" ]]; then
-                unset PERLBREW_PERL
                 eval $(command perlbrew $short_option env $2)
+                __perlbrew_set_path
+            elif [[ -x "$PERLBREW_ROOT/perls/perl-$2/bin/perl" ]]; then
+                eval $(command perlbrew $short_option env "perl-$2")
                 __perlbrew_set_path
             else
                 echo "$2 is not installed" >&2
@@ -74,6 +76,9 @@
                   if [[ -x "$PERLBREW_ROOT/perls/$2/bin/perl" ]]; then
                       perlbrew $short_option use $2
                       __perlbrew_reinit $2
+                  elif [[ -x "$PERLBREW_ROOT/perls/perl-$2/bin/perl" ]]; then
+                      perlbrew $short_option use "perl-$2"
+                      __perlbrew_reinit "perl-$2"
                   else
                       echo "$2 is not installed" >&2
                       exit_status=1
@@ -318,6 +323,17 @@
     }
 
     die "Unknown command: `$x`. Typo?\n" unless $s;
+
+    # Assume 5.12.3 means perl-5.12.3, for example.
+    if ($x =~ /\A(?:switch|use|install|env)\Z/ and my $dist = shift @args) {
+        if ($dist =~ /\A(?:\d+\.)*\d+\Z/) {
+            unshift @args, "perl-$dist";
+        }
+        else {
+            unshift @args, $dist;
+        }
+    }
+
     $self->$s(@args);
 }
 
@@ -494,19 +510,27 @@
     my $dist_tarball_url  = $dist;
     $dist = "$dist_name-$dist_version"; # we install it as this name later
 
-    print "Fetching $dist as $dist_tarball_path\n";
-    http_get(
-        $dist_tarball_url,
-        undef,
-        sub {
-            my ($body) = @_;
-            open my $BALL, "> $dist_tarball_path" or die "Couldn't open $dist_tarball_path: $!";
-            print $BALL $body;
-            close $BALL;
-        }
-    );
+    if ($dist_tarball_url =~ m/^file/) {
+        print "Installing $dist from local archive $dist_tarball_url\n";
+        $dist_tarball_url =~ s/^file:\/+/\//;
+        $dist_tarball_path = $dist_tarball_url;
+    }
+    else {
+        print "Fetching $dist as $dist_tarball_path\n";
+        http_get(
+            $dist_tarball_url,
+            undef,
+            sub {
+                my ($body) = @_;
+                open my $BALL, "> $dist_tarball_path" or die "Couldn't open $dist_tarball_path: $!";
+                print $BALL $body;
+                close $BALL;
+            }
+        );
+    }
+
     my $dist_extracted_path = $self->do_extract_tarball($dist_tarball_path);
-    $self->do_install_this($dist_extracted_path, $dist);
+    $self->do_install_this($dist_extracted_path, $dist_version, $dist);
     return;
 }
 
@@ -616,14 +640,17 @@
         return
     }
 
-    my $help_message = "Unknown installation target \"$dist\", abort.\nPlease see `perlbrew help` for the insturction of install command.\n\n";
+    my $help_message = "Unknown installation target \"$dist\", abort.\nPlease see `perlbrew help` for the instruction on using the install command.\n\n";
 
     my ($dist_name, $dist_version) = $dist =~ m/^(.*)-([\d.]+(?:-RC\d+)?|git)$/;
     if (!$dist_name || !$dist_version) { # some kind of special install
         if (-d "$dist/.git") {
             $self->do_install_git($dist);
         }
-        elsif ($dist =~ m/^(?:https?|ftp)/) { # more protocols needed?
+        if (-f $dist) {
+            $self->do_install_archive($dist);
+        }
+        elsif ($dist =~ m/^(?:https?|ftp|file)/) { # more protocols needed?
             $self->do_install_url($dist);
         }
         elsif ($dist =~ m/(?:perl-)?blead$/) {
@@ -640,6 +667,26 @@
         print $help_message;
     }
 
+    return;
+}
+
+sub do_install_archive {
+    my $self = shift;
+    my $dist_tarball_path = shift;
+    my $dist_version;
+    my $installation_name;
+
+    if ($dist_tarball_path =~ m{perl-?(5.+)\.tar\.(gz|bz2)\Z}) {
+        $dist_version = $1;
+        $installation_name = "perl-${dist_version}";
+    }
+
+    unless ($dist_version && $installation_name) {
+        die "Unable to determin perl version from archive filename.\n\nThe archive name should look like perl-5.x.y.tar.gz or perl-5.x.y.tar.bz2\n";
+    }
+
+    my $dist_extracted_path = $self->do_extract_tarball($dist_tarball_path);
+    $self->do_install_this($dist_extracted_path, $dist_version, $installation_name);
     return;
 }
 
@@ -649,11 +696,13 @@
     my @d_options = @{ $self->{D} };
     my @u_options = @{ $self->{U} };
     my @a_options = @{ $self->{A} };
-    $as ||= $self->{as};
+    $as = $self->{as} if $self->{as};
+
     unshift @d_options, qq(prefix=$ROOT/perls/$as);
     push @d_options, "usedevel" if $dist_version =~ /5\.1[13579]|git/;
     print "Installing $dist_extracted_dir into " . $self->path_with_tilde("$ROOT/perls/$as") . "\n";
     print <<INSTALL if $self->{quiet} && !$self->{verbose};
+
 This could take a while. You can run the following command on another shell to track the status:
 
   tail -f @{[ $self->path_with_tilde($self->{log_file}) ]}
@@ -696,11 +745,9 @@
         $make,
         @install
     );
-    $cmd = "($cmd) >> '$self->{log_file}' 2>&1 "
-        if ( $self->{quiet} && !$self->{verbose} );
-
-
-    print $cmd, "\n";
+    $cmd = "($cmd) >> '$self->{log_file}' 2>&1 ";
+
+    print "$cmd\n" if $self->{verbose};
 
     delete $ENV{$_} for qw(PERL5LIB PERL5OPT);
 
@@ -746,7 +793,13 @@
     for (<$ROOT/perls/*>) {
         next if m/current/;
         my ($name) = $_ =~ m/\/([^\/]+$)/;
-        push @result, { name => $name, is_current => (current_perl eq $name) };
+        my $executable = catfile($_, 'bin', 'perl');
+
+        push @result, {
+            name => $name,
+            version => $self->format_perl_version(`$executable -e 'print \$]'`),
+            is_current => (current_perl eq $name)
+        };
     }
 
     my $current_perl_executable = `which perl`;
@@ -757,7 +810,8 @@
         $current_perl_executable_version =
           $self->format_perl_version(`$_ -e 'print \$]'`);
         push @result, {
-            name => $_ . " (" . $current_perl_executable_version . ")",
+            name => $_,
+            version => $current_perl_executable_version,
             is_current => $current_perl_executable && ($_ eq $current_perl_executable)
         } unless index($_, $ROOT) == 0;
     }
@@ -793,7 +847,10 @@
     my $self = shift;
 
     for my $i ( $self->installed_perls ) {
-        print $i->{is_current} ? '* ': '  ', $i->{name}, "\n";
+        print $i->{is_current} ? '* ': '  ',
+            $i->{name},
+            (index($i->{name}, $i->{version}) < $[) ? " ($i->{version})" : "",
+            "\n";
     }
 }
 
@@ -844,6 +901,7 @@
     local $ENV{PERLBREW_PERL} = $dist;
     my $HOME = $self->env('HOME');
 
+    mkpath("${HOME}/.perlbrew");
     system("$0 env $dist > ${HOME}/.perlbrew/init");
 
     print "Switched to $vers. To use it immediately, run this line in this terminal:\n\n    exec @{[ $self->env('SHELL') ]}\n\n";
@@ -852,6 +910,8 @@
 sub run_command_off {
     my $self = shift;
     my $HOME = $self->env("HOME");
+
+    mkpath("${HOME}/.perlbrew");
     system("env PERLBREW_PERL= $0 env > ${HOME}/.perlbrew/init");
 
     print "\nperlbrew is switched off. Please exit this shell and start a new one to make it effective.\n";
@@ -1053,7 +1113,7 @@
     perlbrew available
 
     # Install some Perls
-    perlbrew install perl-5.12.2
+    perlbrew install 5.14.0
     perlbrew install perl-5.8.1
     perlbrew install perl-5.13.6
 
@@ -1064,8 +1124,8 @@
     perlbrew switch perl-5.12.2
     perl -v
 
-    # Switch to another version
-    perlbrew switch perl-5.8.1
+    # Temporarily use another version only in current shell.
+    perlbrew use perl-5.8.1
     perl -v
 
     # Switch to a certain perl executable not managed by perlbrew.
@@ -1099,54 +1159,45 @@
 The recommended way to install perlbrew is to run these statements in
 your shell:
 
-    curl -LO http://xrl.us/perlbrew
-    chmod +x perlbrew
-    ./perlbrew install
-
-or more simply:
-
     curl -L http://xrl.us/perlbrewinstall | bash
 
 After that, C<perlbrew> installs itself to C<~/perl5/perlbrew/bin>,
 and you should follow the instruction on screen to setup your
 C<.bashrc> or C<.cshrc> to put it in your PATH.
+
+The downloaded perlbrew is a self-contained standalone program that
+embeds all non-core modules it uses. It should be runnable with perl
+5.8 or later versions of perl.
+
+This installer also installs a packed version of C<patchperl> to
+C<~/perl5/perlbrew/bin>, which is required to build old perls.
 
 The directory C<~/perl5/perlbrew> will contain all install perl
 executables, libraries, documentations, lib, site_libs. If you need to
 install C<perlbrew>, and the perls it brews, into somewhere else
 because, say, your HOME has limited quota, you can do that by setting
-a C<PERLBREW_ROOT> environment variable before you run C<./perlbrew install>.
-
-    export PERLBREW_ROOT=/mnt/perlbrew
-    ./perlbrew install
-
-The downloaded perlbrew is a self-contained standalone program that
-embeds all non-core modules it uses. It should be runnable with perl
-5.8 or later versions of perl.
-
-You may also install perlbrew from CPAN with cpan / cpanp / cpanm:
+a C<PERLBREW_ROOT> environment variable before running the installer:
+
+    export PERLBREW_ROOT=/opt/perlbrew
+    curl -L http://xrl.us/perlbrewinstall | bash
+
+You may also install perlbrew from CPAN:
 
     cpan App::perlbrew
 
-This installs 'perlbrew' into your current PATH and it is always
-executed with your current perl.
-
-NOTICE. When you install or upgrade perlbrew with cpan / cpanp /
-cpanm, make sure you are not using one of the perls brewed with
-perlbrew. If so, the `perlbrew` executable you just installed will not
-be available after you switch to other perls. You might not be able to
-invoke further C<perlbrew> commands after so because the executable
-C<perlbrew> is not in your C<PATH> anymore. Installing it again with
-cpan can temporarily solve this problem. To ensure you are not using
-a perlbrewed perl, run C<perlbrew off> before upgrading.
-
-
-It should be relatively safe to install C<App::perlbrew> with system
-cpan (like C</usr/bin/cpan>) because then it will be installed under a
-system PATH like C</usr/bin>, which is not affected by C<perlbrew switch>
-command.
-
-Again, it is recommended to let C<perlbrew> install itself. It's
+However, please make sure not to run this with one of the perls brewed
+with perlbrew. It's the best to turn perlbrew off before you run that,
+if you're upgrading.
+
+    perlbrew off
+    cpan App::perlbrew
+
+You should always use system cpan (like /usr/bin/cpan) to install
+C<App::perlbrew> because then it will be installed under a system PATH
+like C</usr/bin>, which is not affected by perlbrew C<switch> or
+C<use> command.
+
+However, it is still recommended to let C<perlbrew> install itself. It's
 easier, and it works better.
 
 =head1 USAGE
@@ -1181,13 +1232,7 @@
 
 =head1 CONTRIBUTORS
 
-Patches and code improvements have been contributed by:
-
-Tatsuhiko Miyagawa, Chris Prather, Yanick Champoux, aero, Jason May,
-Jesse Leuhrs, Andrew Rodland, Justin Davis, Masayoshi Sekimura,
-castaway, jrockway, chromatic, Goro Fuji, Sawyer X, Danijel Tasov,
-polettix, tokuhirom, Ævar Arnfjörð Bjarmason, Pedro Melo,
-Chad A Davis, dagolden, trcjr, rafl.
+See L<https://github.com/gugod/App-perlbrew/contributors>
 
 =head1 DISCLAIMER OF WARRANTY
 

Modified: branches/upstream/perlbrew/current/t/05.get_current_perl.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/perlbrew/current/t/05.get_current_perl.t?rev=74642&op=diff
==============================================================================
--- branches/upstream/perlbrew/current/t/05.get_current_perl.t (original)
+++ branches/upstream/perlbrew/current/t/05.get_current_perl.t Tue May 17 15:44:16 2011
@@ -12,7 +12,6 @@
     sub {
         $app->run_command('version');
     },
-    "t/05.get_current_perl.t  - App::perlbrew/0.20\n",
+    "t/05.get_current_perl.t  - App::perlbrew/0.21\n",
     'Test version'
 );
-

Added: branches/upstream/perlbrew/current/t/06.installed_perls.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/perlbrew/current/t/06.installed_perls.t?rev=74642&op=file
==============================================================================
--- branches/upstream/perlbrew/current/t/06.installed_perls.t (added)
+++ branches/upstream/perlbrew/current/t/06.installed_perls.t Tue May 17 15:44:16 2011
@@ -1,0 +1,23 @@
+#!/usr/bin/env perl
+use strict;
+use warnings;
+use lib qw(lib);
+use Test::More;
+use App::perlbrew;
+
+my $app = App::perlbrew->new();
+my @perls = $app->installed_perls;
+
+unless(@perls) {
+    plan skip_all => "No perl installation under PERLBREW_ROOT";
+    exit;
+}
+
+for my $perl (@perls) {
+    is ref($perl), 'HASH';
+    ok defined $perl->{name},       "Name: $perl->{name}";
+    ok defined $perl->{version},    "Version: $perl->{version}";
+    ok defined $perl->{is_current}, "Current?: " . ($perl->{is_current} ? "true" : "false");
+}
+
+done_testing;




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