Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

regen

  • Loading branch information...
commit 143eee9b7da34a6b3dd39e01aa484070fd044484 1 parent 84cbe4f
Kang-min Liu gugod authored
Showing with 31 additions and 9 deletions.
  1. +31 −9 perlbrew
40 perlbrew
View
@@ -7,7 +7,7 @@ use 5.008;
use Getopt::Long ();
use File::Spec::Functions qw( catfile );
-our $VERSION = "0.15";
+our $VERSION = "0.15_99";
our $CONF;
my $ROOT = $ENV{PERLBREW_ROOT} || "$ENV{HOME}/perl5/perlbrew";
@@ -22,9 +22,11 @@ if [[ -f $HOME/.perlbrew/init ]]; then
source $HOME/.perlbrew/init
fi
+short_option=""
+
__perlbrew_reinit () {
echo '# DO NOT EDIT THIS FILE' > $HOME/.perlbrew/init
- command perlbrew env $1 >> $HOME/.perlbrew/init
+ command perlbrew $short_option env $1 >> $HOME/.perlbrew/init
source $HOME/.perlbrew/init
__perlbrew_set_path
}
@@ -38,14 +40,20 @@ __perlbrew_set_path
perlbrew () {
local exit_status
+
+ if [[ `echo $1 | awk 'BEGIN{FS=""}{print $1}'` = '-' ]]; then
+ short_option=$1
+ shift
+ fi
+
case $1 in
(use)
if [[ -x "$PERLBREW_ROOT/perls/$2/bin/perl" ]]; then
- eval $(command perlbrew env $2)
+ eval $(command perlbrew $short_option env $2)
__perlbrew_set_path
elif [[ "$2" = "system" ]]; then
unset PERLBREW_PERL
- eval $(command perlbrew env)
+ eval $(command perlbrew $short_option env)
__perlbrew_set_path
else
echo "$2 is not installed" >&2
@@ -76,13 +84,13 @@ perlbrew () {
fi
unset PERLBREW_PERL
- command perlbrew off
+ command perlbrew $short_option off
__perlbrew_reinit
;;
(*)
- command perlbrew $*
+ command perlbrew $short_option $*
exit_status=$?
;;
esac
@@ -195,6 +203,8 @@ sub new {
'D=s@',
'U=s@',
'A=s@',
+
+ 'j=i'
)
or run_command_help(1);
@@ -447,7 +457,18 @@ INSTALL
$configure_flags = '-de';
}
- my @install = $self->{notest} ? "make install" : ("make test", "make install");
+ # Test via "make test_harness" if available so we'll get
+ # automatic parallel testing via $HARNESS_OPTIONS. The
+ # "test_harness" target was added in 5.7.3, which was the last
+ # development release before 5.8.0.
+ my $test_target = "test";
+ if ($dist_version =~ /^5\.(\d+)\.(\d+)/
+ && ($1 >= 8 || $1 == 7 && $2 == 3)) {
+ $test_target = "test_harness";
+ }
+
+ my $make = "make " . ($self->{j} ? "-j$self->{j}" : "");
+ my @install = $self->{notest} ? "make install" : ("make $test_target", "make install");
@install = join " && ", @install unless($self->{force});
my $cmd = join ";",
@@ -465,7 +486,8 @@ INSTALL
&& ($1 < 8 || $1 == 8 && $2 < 9)
? ("$^X -i -nle 'print unless /command-line/' makefile x2p/makefile")
: (),
- "make", @install
+ $make,
+ @install
);
$cmd = "($cmd) >> '$self->{log_file}' 2>&1 "
if ( $self->{quiet} && !$self->{verbose} );
@@ -661,7 +683,7 @@ sub run_command_env {
my %env = $self->perlbrew_env($perl);
- if ($self->env('SHELL') =~ /(ba|z)sh$/) {
+ if ($self->env('SHELL') =~ /(ba|z|\/)sh$/) {
while (my ($k, $v) = each(%env)) {
print "export $k=$v\n";
}
Please sign in to comment.
Something went wrong with that request. Please try again.