r74981 - in /branches/upstream/perlbrew/current: Changes META.yml Makefile.PL lib/App/perlbrew.pm t/installation.t

ghedo-guest at users.alioth.debian.org ghedo-guest at users.alioth.debian.org
Tue May 31 17:29:59 UTC 2011


Author: ghedo-guest
Date: Tue May 31 17:29:34 2011
New Revision: 74981

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

Modified:
    branches/upstream/perlbrew/current/Changes
    branches/upstream/perlbrew/current/META.yml
    branches/upstream/perlbrew/current/Makefile.PL
    branches/upstream/perlbrew/current/lib/App/perlbrew.pm
    branches/upstream/perlbrew/current/t/installation.t

Modified: branches/upstream/perlbrew/current/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/perlbrew/current/Changes?rev=74981&op=diff
==============================================================================
--- branches/upstream/perlbrew/current/Changes (original)
+++ branches/upstream/perlbrew/current/Changes Tue May 31 17:29:34 2011
@@ -1,3 +1,9 @@
+0.23:
+- dependency fixes
+- Fix auto-detection of curl
+- Support OpenBSD pdksh. The provided bashrc should be compatible with pdksh.
+- Small improvement of 'exec' command. `perlbrew exec perl -v` now works.
+
 0.22:
 - Fix ccache support on Linux with bash.. GH #87.
 - `install` command no longer clobbers existing installations.

Modified: branches/upstream/perlbrew/current/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/perlbrew/current/META.yml?rev=74981&op=diff
==============================================================================
--- branches/upstream/perlbrew/current/META.yml (original)
+++ branches/upstream/perlbrew/current/META.yml Tue May 31 17:29:34 2011
@@ -4,6 +4,7 @@
   - 'Kang-min Liu  C<< <gugod at gugod.org> >>'
 build_requires:
   ExtUtils::MakeMaker: 6.42
+  IO::All: 0
   Path::Class: 0
   Test::Exception: 0
   Test::More: 0
@@ -30,4 +31,4 @@
 resources:
   license: http://opensource.org/licenses/mit-license.php
   repository: git://github.com/gugod/App-perlbrew.git
-version: 0.22
+version: 0.23

Modified: branches/upstream/perlbrew/current/Makefile.PL
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/perlbrew/current/Makefile.PL?rev=74981&op=diff
==============================================================================
--- branches/upstream/perlbrew/current/Makefile.PL (original)
+++ branches/upstream/perlbrew/current/Makefile.PL Tue May 31 17:29:34 2011
@@ -56,6 +56,7 @@
 test_requires 'Test::Output';
 test_requires 'Test::Exception';
 test_requires 'Path::Class';
+test_requires 'IO::All';
 
 install_script 'bin/perlbrew';
 

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=74981&op=diff
==============================================================================
--- branches/upstream/perlbrew/current/lib/App/perlbrew.pm (original)
+++ branches/upstream/perlbrew/current/lib/App/perlbrew.pm Tue May 31 17:29:34 2011
@@ -5,10 +5,11 @@
 use Getopt::Long ();
 use File::Spec::Functions qw( catfile );
 
-our $VERSION = "0.22";
+our $VERSION = "0.23";
 our $CONF;
 
 my $ROOT         = $ENV{PERLBREW_ROOT} || "$ENV{HOME}/perl5/perlbrew";
+my $PB_HOME      = $ENV{PERLBREW_HOME} || "$ENV{HOME}/.perlbrew";
 my $CONF_FILE    = catfile( $ROOT, 'Conf.pm' );
 my $CURRENT_PERL = $ENV{PERLBREW_PERL};
 
@@ -16,24 +17,28 @@
 
 sub BASHRC_CONTENT() {
     return <<'RC';
-if [[ -f $HOME/.perlbrew/init ]]; then
-    source $HOME/.perlbrew/init
+if [[ -z "$PERLBREW_HOME" ]]; then
+    export PERLBREW_HOME=$HOME/.perlbrew
 fi
 
+if [[ -f $PERLBREW_HOME/init ]]; then
+    . $PERLBREW_HOME/init
+fi
+
 __perlbrew_reinit () {
-    if [[ ! -d $HOME/.perlbrew ]]; then
-        mkdir -p $HOME/.perlbrew
+    if [[ ! -d $PERLBREW_HOME ]]; then
+        mkdir -p $PERLBREW_HOME
     fi
 
-    echo '# DO NOT EDIT THIS FILE' >| $HOME/.perlbrew/init
-    command perlbrew env $1 >> $HOME/.perlbrew/init
-    source $HOME/.perlbrew/init
+    echo '# DO NOT EDIT THIS FILE' >| $PERLBREW_HOME/init
+    command perlbrew env $1 >> $PERLBREW_HOME/init
+    . $PERLBREW_HOME/init
     __perlbrew_set_path
 }
 
 __perlbrew_set_path () {
     [[ -z "$PERLBREW_ROOT" ]] && return 1
-    hash -d perl 2>/dev/null
+    unalias perl 2>/dev/null
     export PATH_WITHOUT_PERLBREW=$(perl -e 'print join ":", grep { index($_, $ENV{PERLBREW_ROOT}) } split/:/,$ENV{PATH};')
     export PATH=$PERLBREW_PATH:$PATH_WITHOUT_PERLBREW
 }
@@ -195,7 +200,8 @@
             );
             for my $command (@commands) {
                 my $program = $command->[0];
-                if (! system("$program --version >/dev/null 2>&1")) {
+                my $code = system("$program --version >/dev/null 2>&1") >> 8;
+                if ($code != 127) {
                     @command = @$command;
                     last;
                 }
@@ -225,6 +231,7 @@
     my($class, @argv) = @_;
 
     my %opt = (
+        original_argv  => \@argv,
         force => 0,
         quiet => 1,
         D => [],
@@ -261,14 +268,14 @@
     )
       or run_command_help(1);
 
+    $opt{args} = \@ARGV;
+
     # fix up the effect of 'bundling'
     foreach my $flags (@opt{qw(D U A)}) {
         foreach my $value(@{$flags}) {
             $value =~ s/^=//;
         }
     }
-
-    $opt{args} = \@ARGV;
 
     return bless \%opt, $class;
 }
@@ -395,7 +402,7 @@
     my $HOME = $self->env('HOME');
 
     mkpath($_) for (
-        "$HOME/.perlbrew",
+        "$PB_HOME",
         "$ROOT/perls", "$ROOT/dists", "$ROOT/build", "$ROOT/etc",
         "$ROOT/bin"
     );
@@ -418,20 +425,28 @@
         $shrc = $yourshrc = 'bashrc';
     }
 
-    system("$0 env @{[ $self->current_perl ]}> ${HOME}/.perlbrew/init");
+    system("$0 env @{[ $self->current_perl ]}> ${PB_HOME}/init");
 
     $self->run_command_symlink_executables;
 
     my $root_dir = $self->path_with_tilde($ROOT);
+    my $pb_home_dir = $self->path_with_tilde($PB_HOME);
 
     print <<INSTRUCTION;
 Perlbrew environment initiated, required directories are created under
 
     $root_dir
 
-Paste the following line to the end of your ~/.${yourshrc} and start a
+Paste the following line(s) to the end of your ~/.${yourshrc} and start a
 new shell, perlbrew should be up and fully functional from there:
 
+INSTRUCTION
+
+    if ($PB_HOME ne "$ENV{HOME}/.perlbrew") {
+        print "export PERLBREW_HOME=$pb_home_dir\n";
+    }
+
+    print <<INSTRUCTION;
     source $root_dir/etc/${shrc}
 
 For further instructions, simply run `perlbrew` to see the help message.
@@ -993,7 +1008,7 @@
 
     my %env = $self->perlbrew_env($perl);
 
-    if ($self->env('SHELL') =~ /(ba|z|\/)sh$/) {
+    if ($self->env('SHELL') =~ /(ba|k|z|\/)sh$/) {
         while (my ($k, $v) = each(%env)) {
             print "export $k=$v\n";
         }
@@ -1067,7 +1082,9 @@
 }
 
 sub run_command_exec {
-    my ($self, @args) = @_;
+    my $self = shift;
+    my @args = @{$self->{original_argv}};
+    shift @args;
 
     for my $i ( $self->installed_perls ) {
         my %env = $self->perlbrew_env($i->{name});
@@ -1262,7 +1279,7 @@
 first. C<perlbrew> depends on one of this two external commmands to be
 there in order to fetch files from the internet.
 
-The recommended way to install perlbrew is to run these statements in
+The recommended way to install perlbrew is to run this statement in
 your shell:
 
     curl -L http://xrl.us/perlbrewinstall | bash
@@ -1286,6 +1303,33 @@
 
     export PERLBREW_ROOT=/opt/perlbrew
     curl -L http://xrl.us/perlbrewinstall | bash
+
+By default, C<perlbrew> looks for the intialization file that exports
+C<PERLBREW_ROOT> in C<~/.perlbrew/init>.  In some cases (for instance,
+if your home directory is shared across multiple machines), you may
+wish to have several different perlbrew setting per-machine. If so,
+you can use the C<PERLBREW_HOME> environment variable to tell perlbrew
+where to look for the initialization file.
+
+ # on machine a
+ $ PERLBREW_HOME=~/.perlbrew-a PERLBREW_ROOT=~/perl5/perlbrew-a ./perlbrew install
+
+ # on machine b
+ $ PERLBREW_HOME=~/.perlbrew-b PERLBREW_ROOT=~/perl5/perlbrew-b ./perlbrew install
+
+If you specify C<PERLBREW_HOME>, you will also need to specify both
+C<PERLBREW_HOME> and C<PERLBREW_ROOT> when you first install perlbrew.
+After that, you'll need to make sure C<PERLBREW_HOME> is exported when
+you log in, before you source C<$PERLBREW_ROOT/etc/bashrc> (or
+C<cshrc>). Example C<.bashrc>:
+
+    if [ "$(hostname)" == "machine-a" ]; then
+        export PERLBREW_HOME=~/.perlbrew-a
+        source ~/perl5/perlbrew-a/etc/bashrc
+    elif [ "$(hostname)" == "machine-b" ]; then
+        export PERLBREW_HOME=~/.perlbrew-b
+        source ~/perl5/perlbrew-b/etc/bashrc
+    fi
 
 You may also install perlbrew from CPAN:
 

Modified: branches/upstream/perlbrew/current/t/installation.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/perlbrew/current/t/installation.t?rev=74981&op=diff
==============================================================================
--- branches/upstream/perlbrew/current/t/installation.t (original)
+++ branches/upstream/perlbrew/current/t/installation.t Tue May 31 17:29:34 2011
@@ -10,7 +10,6 @@
 use Test::More;
 use Test::Exception;
 use App::perlbrew;
-use Try::Tiny;
 
 ## setup
 




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