Hello community, here is the log from the commit of package perl-App-perlbrew for openSUSE:Factory checked in at 2015-04-21 10:51:38 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/perl-App-perlbrew (Old) and /work/SRC/openSUSE:Factory/.perl-App-perlbrew.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "perl-App-perlbrew" Changes: -------- --- /work/SRC/openSUSE:Factory/perl-App-perlbrew/perl-App-perlbrew.changes 2014-10-01 07:40:47.000000000 +0200 +++ /work/SRC/openSUSE:Factory/.perl-App-perlbrew.new/perl-App-perlbrew.changes 2015-04-21 10:51:40.000000000 +0200 @@ -1,0 +2,18 @@ +Fri Apr 17 08:44:02 UTC 2015 - co...@suse.com + +- updated to 0.73 + see /usr/share/doc/packages/perl-App-perlbrew/Changes + + 0.73: # 2015-02-01T09:59:45+0100 + - fixes and improvements from Manuel Streuhofer, Aristotle Pagaltzis, Sebastian Willert, David Hand, Eric Enns, + Peter Roberts, Thomas Sibley, Ivan Baidakou, thanks! + - fix 'perlbrew user' for fish users https://github.com/gugod/App-perlbrew/pull/429 + - fix sub-shell for bash users https://github.com/gugod/App-perlbrew/pull/435 + - clarify the 'perlbrew use' output: https://github.com/gugod/App-perlbrew/issues/439 + + + 0.72: # 2014-10-27T21:38:19+0100 + - Fix 0.71 breakage on MacOSX when the shell is bash or zsh + - Fix spelling mistake. by @gregoa++ + +------------------------------------------------------------------- Old: ---- App-perlbrew-0.71.tar.gz New: ---- App-perlbrew-0.73.tar.gz cpanspec.yml ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ perl-App-perlbrew.spec ++++++ --- /var/tmp/diff_new_pack.IgDxG9/_old 2015-04-21 10:51:41.000000000 +0200 +++ /var/tmp/diff_new_pack.IgDxG9/_new 2015-04-21 10:51:41.000000000 +0200 @@ -1,7 +1,7 @@ # # spec file for package perl-App-perlbrew # -# Copyright (c) 2014 SUSE LINUX Products GmbH, Nuernberg, Germany. +# Copyright (c) 2015 SUSE LINUX GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -17,21 +17,22 @@ Name: perl-App-perlbrew -Version: 0.71 +Version: 0.73 Release: 0 %define cpan_name App-perlbrew Summary: Manage perl installations in your $HOME License: MIT Group: Development/Libraries/Perl Url: http://search.cpan.org/dist/App-perlbrew/ -Source: http://www.cpan.org/authors/id/G/GU/GUGOD/%{cpan_name}-%{version}.tar.gz +Source0: http://www.cpan.org/authors/id/G/GU/GUGOD/%{cpan_name}-%{version}.tar.gz +Source1: cpanspec.yml BuildArch: noarch BuildRoot: %{_tmppath}/%{name}-%{version}-build BuildRequires: perl BuildRequires: perl-macros -BuildRequires: perl(CPAN::Perl::Releases) >= 1.84 +BuildRequires: perl(CPAN::Perl::Releases) >= 1.94 BuildRequires: perl(Capture::Tiny) >= 0.25 -BuildRequires: perl(Devel::PatchPerl) >= 1.24 +BuildRequires: perl(Devel::PatchPerl) >= 1.28 BuildRequires: perl(File::Temp) >= 0.2304 BuildRequires: perl(IO::All) >= 0.51 BuildRequires: perl(Path::Class) >= 0.33 @@ -44,16 +45,17 @@ BuildRequires: perl(Test::Simple) >= 1.001002 BuildRequires: perl(Test::Spec) >= 0.47 BuildRequires: perl(local::lib) >= 2.000014 -Requires: perl(CPAN::Perl::Releases) >= 1.84 +Requires: perl(CPAN::Perl::Releases) >= 1.94 Requires: perl(Capture::Tiny) >= 0.25 -Requires: perl(Devel::PatchPerl) >= 1.24 +Requires: perl(Devel::PatchPerl) >= 1.28 Requires: perl(Pod::Parser) >= 1.62 Requires: perl(Pod::Usage) >= 1.64 Requires: perl(local::lib) >= 2.000014 %{perl_requires} -# MANUAL +# MANUAL BEGIN BuildRequires: groff BuildRequires: wget +# MANUAL END %description perlbrew is a program to automate the building and installation of perl in ++++++ App-perlbrew-0.71.tar.gz -> App-perlbrew-0.73.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/App-perlbrew-0.71/Changes new/App-perlbrew-0.73/Changes --- old/App-perlbrew-0.71/Changes 2014-09-13 20:01:52.000000000 +0200 +++ new/App-perlbrew-0.73/Changes 2015-02-01 10:08:01.000000000 +0100 @@ -1,3 +1,15 @@ +0.73: # 2015-02-01T09:59:45+0100 +- fixes and improvements from Manuel Streuhofer, Aristotle Pagaltzis, Sebastian Willert, David Hand, Eric Enns, + Peter Roberts, Thomas Sibley, Ivan Baidakou, thanks! +- fix 'perlbrew user' for fish users https://github.com/gugod/App-perlbrew/pull/429 +- fix sub-shell for bash users https://github.com/gugod/App-perlbrew/pull/435 +- clarify the 'perlbrew use' output: https://github.com/gugod/App-perlbrew/issues/439 + + +0.72: # 2014-10-27T21:38:19+0100 +- Fix 0.71 breakage on MacOSX when the shell is bash or zsh +- Fix spelling mistake. by @gregoa++ + 0.71: # 2014-09-13T19:59:15+0200 - Fix a few bugs of having unwanted values in PERL5LIB when switching between libs diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/App-perlbrew-0.71/META.yml new/App-perlbrew-0.73/META.yml --- old/App-perlbrew-0.71/META.yml 2014-09-13 20:09:58.000000000 +0200 +++ new/App-perlbrew-0.73/META.yml 2015-02-01 10:08:35.000000000 +0100 @@ -29,9 +29,9 @@ - inc - t requires: - CPAN::Perl::Releases: '1.84' + CPAN::Perl::Releases: '1.94' Capture::Tiny: '0.25' - Devel::PatchPerl: '1.24' + Devel::PatchPerl: '1.28' Pod::Parser: '1.62' Pod::Usage: '1.64' local::lib: '2.000014' @@ -39,4 +39,4 @@ resources: license: http://opensource.org/licenses/mit-license.php repository: git://github.com/gugod/App-perlbrew.git -version: '0.71' +version: '0.73' diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/App-perlbrew-0.71/Makefile.PL new/App-perlbrew-0.73/Makefile.PL --- old/App-perlbrew-0.71/Makefile.PL 2014-09-13 20:01:41.000000000 +0200 +++ new/App-perlbrew-0.73/Makefile.PL 2015-01-14 08:53:55.000000000 +0100 @@ -7,9 +7,9 @@ repository 'git://github.com/gugod/App-perlbrew.git'; requires - 'CPAN::Perl::Releases' => '1.84', + 'CPAN::Perl::Releases' => '1.94', 'Capture::Tiny' => '0.25', - 'Devel::PatchPerl' => '1.24', + 'Devel::PatchPerl' => '1.28', 'Pod::Parser' => '1.62', 'Pod::Usage' => '1.64', 'local::lib' => '2.000014'; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/App-perlbrew-0.71/bin/perlbrew new/App-perlbrew-0.73/bin/perlbrew --- old/App-perlbrew-0.71/bin/perlbrew 2014-09-05 20:56:01.000000000 +0200 +++ new/App-perlbrew-0.73/bin/perlbrew 2015-02-01 10:07:22.000000000 +0100 @@ -315,7 +315,7 @@ Usage: perlbrew list -List all perl installations inside perlbrew root specifed by C<$PERLBREW_ROOT> +List all perl installations inside perlbrew root specified by C<$PERLBREW_ROOT> environment variable. By default, the value is C<~/perl5/perlbrew>. If there are libs associated to some perl installations, they will be included @@ -428,7 +428,7 @@ =head1 COMMAND: ENV -Usage: perlbrew env <name> +Usage: perlbrew env [ <name> ] Low-level command. Invoke this command to see the list of environment variables that are set by C<perlbrew> itself for shell integration. @@ -444,7 +444,7 @@ =head1 COMMAND: SYMLINK-EXECUTABLES -Usage: perlbrew symlink-executables <name> +Usage: perlbrew symlink-executables [ <name> ] Low-level command. This command is used to create the C<perl> executable symbolic link to, say, C<perl5.13.6>. This is only required for @@ -526,7 +526,7 @@ =head1 COMMAND: LIB -Usage: +Usage: perlbrew lib <action> <lib-name> perlbrew lib list perlbrew lib create <lib-name> @@ -542,21 +542,33 @@ Here are some a brief examples to invoke the `lib` command: - # Create libs by name - perlbrew lib create nobita + # Create lib perl-5.12.3@shizuka perlbrew lib create perl-5.12.3@shizuka - perlbrew list # See the list of use/switch targets. + # Create lib perl-5.14.2@nobita and perl-5.14.2@shizuka + perlbrew use perl-5.14.2 + perlbrew lib create nobita + perlbrew lib create shizuka + + # See the list of use/switch targets + perlbrew list - # Activate a lib in current shell. - perlbrew use perl-5.12.3@nobita + # Activate a lib in current shell + perlbrew use perl-5.12.3@shizuka perlbrew use perl-5.14.2@nobita + perlbrew use perl-5.14.2@shizuka - # Activate a lib as default. + # Activate a lib as default + perlbrew switch perl-5.12.3@shizuka perlbrew switch perl-5.14.2@nobita + perlbrew switch perl-5.14.2@shizuka - # Delete the lib + # Delete lib perl-5.14.2@nobita and perl-5.14.2@shizuka + perlbrew use perl-5.14.2 perlbrew lib delete nobita + perlbrew lib delete shizuka + + # Delete lib perl-5.12.3@shizuka perlbrew lib delete perl-5.12.3@shizuka Short lib names are local to current perl. A lib name 'nobita' can refer to diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/App-perlbrew-0.71/lib/App/perlbrew.pm new/App-perlbrew-0.73/lib/App/perlbrew.pm --- old/App-perlbrew-0.71/lib/App/perlbrew.pm 2014-09-13 20:01:52.000000000 +0200 +++ new/App-perlbrew-0.73/lib/App/perlbrew.pm 2015-02-01 10:08:01.000000000 +0100 @@ -2,7 +2,7 @@ use strict; use warnings; use 5.008; -our $VERSION = "0.71"; +our $VERSION = "0.73"; use Config; BEGIN { @@ -19,9 +19,16 @@ @INC = @oldinc; } -use List::Util qw/min/; use Getopt::Long (); +sub min(@) { + my $m = $_[0]; + for(@_) { + $m = $_ if $_ < $m; + } + return $m; +} + sub uniq { my %seen; grep { !$seen{$_}++ } @_; } @@ -88,6 +95,7 @@ ### functions sub joinpath { join "/", @_ } +sub splitpath { split "/", $_[0] } sub mkpath { require File::Path; @@ -326,6 +334,7 @@ 'root=s', 'switch', 'all', + 'shell=s', # options passed directly to Configure 'D=s@', @@ -369,6 +378,16 @@ return $self->{current_lib} || $self->env('PERLBREW_LIB') || ''; } +sub current_shell { + my ($self, $x) = @_; + $self->{current_shell} = $x if $x; + return $self->{current_shell} ||= do { + my $shell_name = (splitpath($self->{shell} || $self->env('SHELL')))[-1]; + $shell_name =~ s/\d+$//; + $shell_name; + }; +} + sub current_env { my ($self) = @_; my $l = $self->current_lib; @@ -424,7 +443,7 @@ sub path_with_tilde { my ($self, $dir) = @_; my $home = $self->env('HOME'); - $dir =~ s/^\Q$home\E/~/ if $home; + $dir =~ s!\Q$home/\E!~/! if $home; return $dir; } @@ -536,7 +555,7 @@ } sub run_command_help { - my ($self, $status, $verbose) = @_; + my ($self, $status, $verbose, $return_text) = @_; require Pod::Usage; @@ -562,6 +581,7 @@ $out = "Cannot find documentation for '$status'\n\n"; } + return "\n$out" if ($return_text); print "\n$out"; close $fh; } @@ -730,9 +750,7 @@ my @args = @_; if (@args && $args[0] eq '-') { - if ($self->is_shell_csh) { - } - else { + if ($self->current_shell =~ /(ba|z)?sh/) { $self->run_command_init_in_bash; } exit 0; @@ -771,16 +789,15 @@ } my ( $shrc, $yourshrc ); - if ( $self->is_shell_csh) { + if ( $self->current_shell =~ m/(t?csh)/ ) { $shrc = 'cshrc'; - $self->env("SHELL") =~ m/(t?csh)/; $yourshrc = $1 . "rc"; } - elsif ($self->env("SHELL") =~ m/zsh\d?$/) { + elsif ($self->current_shell =~ m/zsh\d?$/) { $shrc = "bashrc"; $yourshrc = 'zshenv'; } - elsif( $self->env('SHELL') =~ m/fish/ ) { + elsif( $self->current_shell eq 'fish' ) { $shrc = "perlbrew.fish"; $yourshrc = 'config/fish/config.fish'; } @@ -793,7 +810,7 @@ my $pb_home_dir = $self->path_with_tilde($PERLBREW_HOME); my $code = qq( source $root_dir/etc/${shrc}); - if ($PERLBREW_HOME ne joinpath($ENV{HOME}, ".perlbrew")) { + if ($PERLBREW_HOME ne joinpath($self->env('HOME'), ".perlbrew")) { $code = " export PERLBREW_HOME=$pb_home_dir\n" . $code; } @@ -1396,6 +1413,15 @@ or die "Could not open '$sitecustomize' for reading: $!\n"; print {$dst} do { local $/; <$src> }; } + + my $version_file = + joinpath( $self->root, 'perls', $installation_name, '.version' ); + + if ( -e $version_file ) { + unlink($version_file) + or die "Could not unlink $version_file file: $!\n"; + } + print "$installation_name is successfully installed.\n"; } else { @@ -1423,7 +1449,7 @@ my $body = http_get($url) or die "\nERROR: Failed to retrieve $program_name executable.\n\n"; unless ($body =~ m{\A#!/}s) { - my $x = joinpath($ENV{TMPDIR} || "/tmp", "${program_name}.downloaded.$$"); + my $x = joinpath($self->env('TMPDIR') || "/tmp", "${program_name}.downloaded.$$"); my $message = "\nERROR: The downloaded $program_name program seem to be invalid. Please check if the following URL can be reached correctly\n\n\t$url\n\n...and try again latter."; unless (-f $x) { @@ -1510,7 +1536,7 @@ name => $name, orig_version=> $orig_version, version => $self->format_perl_version($orig_version), - is_current => ($self->current_perl eq $name) && !$self->env("PERLBREW_LIB"), + is_current => ($self->current_perl eq $name) && !($self->current_lib), libs => [ $self->local_libs($name) ], executable => $executable }; @@ -1675,9 +1701,6 @@ } } - elsif ($shell =~ /\/bash$/) { - $shell_opt = "--noprofile --norc"; - } my %env = ($self->perlbrew_env($name), PERLBREW_SKIP_INIT => 1); @@ -1707,6 +1730,7 @@ if ( !$perl ) { my $current = $self->current_perl; + $current .= '@' . $self->current_lib if ($self->current_lib); if ($current) { print "Currently using $current\n"; } else { @@ -1724,6 +1748,7 @@ unless ( $dist ) { my $current = $self->current_perl; + $current .= '@' . $self->current_lib if ($self->current_lib); printf "Currently switched %s\n", ( $current ? "to $current" : 'off' ); return; @@ -1839,35 +1864,36 @@ my %env = $self->perlbrew_env($name); - if ($self->env('SHELL') =~ /(ba|k|z|\/)sh\d?$/) { - for my $k (sort keys %env) { - my $v = $env{$k}; - if (defined $v) { - if ($v || ($v && exists($ENV{$k}))) { - $v =~ s/(\\")/\\$1/g; - print "export $k=\"$v\"\n"; - } - } - else { - if (exists $ENV{$k}) { - print "unset $k\n"; - } + my @statements; + for my $k (sort keys %env) { + my $v = $env{$k}; + if (defined($v) && $v ne '') { + $v =~ s/(\\")/\\$1/g; + push @statements, ["set", $k, $v]; + } else { + if (exists $ENV{$k}) { + push @statements, ["unset", $k]; } } } - else { - for my $k (sort keys %env) { - my $v = $env{$k}; - if (defined $v) { - if ($v || ($v && exists($ENV{$k}))) { - $v =~ s/(\\")/\\$1/g; - print "setenv $k \"$v\"\n"; - } + + if ($self->env('SHELL') =~ /(ba|k|z|\/)sh\d?$/) { + for (@statements) { + my ($o,$k,$v) = @$_; + if ($o eq 'unset') { + print "unset $k\n"; + } else { + $v =~ s/(\\")/\\$1/g; + print "export $k=\"$v\"\n"; } - else { - if (exists $ENV{$k}) { - print "unsetenv $k\n"; - } + } + } else { + for (@statements) { + my ($o,$k,$v) = @$_; + if ($o eq 'unset') { + print "unsetenv $k\n"; + } else { + print "setenv $k \"$v\"\n"; } } } @@ -2014,12 +2040,15 @@ # return 255 for case when process was terminated with signal, in that case real exit code is useless and weird $exit_code = 255 if $exit_code > 255; $overall_success = 0; - print "Command terminated with non-zero status.\n" unless $self->{quiet}; - print STDERR "Command [" . - join(' ', map { /\s/ ? "'$_'" : $_ } @ARGV) . # trying reverse shell escapes - quote arguments containing spaces - "] terminated with exit code $exit_code (\$? = $err) under the following perl environment:\n"; - print STDERR $self->format_info_output; + unless ($self->{quiet}) { + print "Command terminated with non-zero status.\n"; + + print STDERR "Command [" . + join(' ', map { /\s/ ? "'$_'" : $_ } @ARGV) . # trying reverse shell escapes - quote arguments containing spaces + "] terminated with exit code $exit_code (\$? = $err) under the following perl environment:\n"; + print STDERR $self->format_info_output; + } $self->do_exit_with_error_code($exit_code) if ($opts{'halt-on-error'}); } @@ -2050,18 +2079,9 @@ sub run_command_alias { my ($self, $cmd, $name, $alias) = @_; - if (!$cmd) { - print <<USAGE; - -Usage: perlbrew alias [-f] <action> <name> [<alias>] - - perlbrew alias create <name> <alias> - perlbrew alias delete <alias> - perlbrew alias rename <old_alias> <new_alias> - -USAGE - - return; + unless($cmd) { + $self->run_command_help("alias"); + exit(-1); } my $path_name = joinpath($self->root, "perls", $name); @@ -2124,29 +2144,12 @@ my ($self) = @_; } -sub lib_usage { - my $usage = <<'USAGE'; - -Usage: perlbrew lib <action> <name> [<name> <name> ...] - - perlbrew lib list - perlbrew lib create nobita - perlbrew lib create perl-5.14.2@nobita - - perlbrew use perl-5.14.2@nobita - perlbrew lib delete perl-5.12.3@nobita shizuka - -USAGE - - - return $usage; -} - sub run_command_lib { my ($self, $subcommand, @args) = @_; + unless ($subcommand) { - print lib_usage; - return; + $self->run_command_help("lib"); + exit(-1); } my $sub = "run_command_lib_$subcommand"; @@ -2161,7 +2164,7 @@ sub run_command_lib_create { my ($self, $name) = @_; - die "ERROR: No lib name\n", lib_usage unless $name; + die "ERROR: No lib name\n", $self->run_command_help("lib", undef, 'return_text') unless $name; $name =~ s/^/@/ unless $name =~ /@/; @@ -2190,7 +2193,7 @@ sub run_command_lib_delete { my ($self, $name) = @_; - die "ERROR: No lib to delete\n", lib_usage unless $name; + die "ERROR: No lib to delete\n", $self->run_command_help("lib", undef, 'return_text') unless $name; $name =~ s/^/@/ unless $name =~ /@/; @@ -2198,7 +2201,7 @@ my $fullname = $perl_name . '@' . $lib_name; - my $current = $self->current_perl . '@' . ($self->env("PERLBREW_LIB") || ""); + my $current = $self->current_perl . '@' . $self->current_lib; my $dir = joinpath($PERLBREW_HOME, "libs", $fullname); @@ -2222,18 +2225,13 @@ sub run_command_lib_list { my ($self) = @_; - - my $current = ""; - if ($self->current_perl && $self->env("PERLBREW_LIB")) { - $current = $self->current_perl . "@" . $self->env("PERLBREW_LIB"); - } - my $dir = joinpath($PERLBREW_HOME, "libs"); return unless -d $dir; opendir my $dh, $dir or die "open $dir failed: $!"; my @libs = grep { !/^\./ && /\@/ } readdir($dh); + my $current = $self->current_env; for (@libs) { print $current eq $_ ? "* " : " "; print "$_\n"; @@ -2406,7 +2404,8 @@ } sub BASHRC_CONTENT() { - return "export PERLBREW_BASHRC_VERSION=$VERSION\n\n" . sprintf <<'RC', $PERLBREW_ROOT; + return "export PERLBREW_BASHRC_VERSION=$VERSION\n" . + (exists $ENV{PERLBREW_ROOT} ? "export PERLBREW_ROOT=$PERLBREW_ROOT\n" : "") . "\n" . <<'RC'; __perlbrew_reinit() { if [[ ! -d "$PERLBREW_HOME" ]]; then @@ -2419,45 +2418,35 @@ __perlbrew_set_path } -__perlbrew_set_path () { - MANPATH_WITHOUT_PERLBREW=`perl -e 'print join ":", grep { index($_, $ENV{PERLBREW_HOME}) < 0 } grep { index($_, $ENV{PERLBREW_ROOT}) < 0 } split/:/,qx(manpath 2> /dev/null);'` - if [ -n "$PERLBREW_MANPATH" ]; then - export MANPATH="$PERLBREW_MANPATH:$MANPATH_WITHOUT_PERLBREW" - else - export MANPATH="$MANPATH_WITHOUT_PERLBREW" - fi - unset MANPATH_WITHOUT_PERLBREW - - PATH_WITHOUT_PERLBREW=$(eval $perlbrew_command display-pristine-path) - if [ -n "$PERLBREW_PATH" ]; then - export PATH=${PERLBREW_PATH}:${PATH_WITHOUT_PERLBREW} - else - export PATH=${PERLBREW_ROOT}/bin:${PATH_WITHOUT_PERLBREW} - fi - unset PATH_WITHOUT_PERLBREW +__perlbrew_purify () { + local path patharray outsep + IFS=: read -r${BASH_VERSION+a}${ZSH_VERSION+A} patharray <<< "$1" + for path in "${patharray[@]}" ; do + case "$path" in + (*"$PERLBREW_HOME"*) ;; + (*"$PERLBREW_ROOT"*) ;; + (*) printf '%s' "$outsep$path" ; outsep=: ;; + esac + done +} +__perlbrew_set_path () { + export MANPATH=$PERLBREW_MANPATH${PERLBREW_MANPATH:+:}$(__perlbrew_purify "$(manpath 2>/dev/null)") + export PATH=${PERLBREW_PATH:-$PERLBREW_ROOT/bin}:$(__perlbrew_purify "$PATH") hash -r } __perlbrew_set_env() { - local code="$($perlbrew_command env $@)" - local exit_status="$?" - if [[ $exit_status -eq 0 ]] ; then - eval "$code" - else - return $exit_status - fi + local code + code="$($perlbrew_command env $@)" || return $? + eval "$code" } __perlbrew_activate() { [[ -n $(alias perl 2>/dev/null) ]] && unalias perl 2>/dev/null if [[ -n "$PERLBREW_PERL" ]]; then - if [[ -z "$PERLBREW_LIB" ]]; then - __perlbrew_set_env $PERLBREW_PERL - else - __perlbrew_set_env $PERLBREW_PERL@$PERLBREW_LIB - fi + __perlbrew_set_env "$PERLBREW_PERL${PERLBREW_LIB:+@}$PERLBREW_LIB" fi __perlbrew_set_path @@ -2485,11 +2474,9 @@ case $1 in (use) if [[ -z "$2" ]] ; then - if [[ -z "$PERLBREW_PERL" ]] ; then - echo "Currently using system perl" - else - echo "Currently using $PERLBREW_PERL" - fi + echo -n "Currently using ${PERLBREW_PERL:-system perl}" + [ -n "$PERLBREW_LIB" ] && echo -n "@$PERLBREW_LIB" + echo else __perlbrew_set_env "$2" exit_status="$?" @@ -2532,7 +2519,7 @@ return ${exit_status:-0} } -[[ -z "$PERLBREW_ROOT" ]] && export PERLBREW_ROOT="%s" +[[ -z "$PERLBREW_ROOT" ]] && export PERLBREW_ROOT="$HOME/perl5/perlbrew" [[ -z "$PERLBREW_HOME" ]] && export PERLBREW_HOME="$HOME/.perlbrew" if [[ ! -n "$PERLBREW_SKIP_INIT" ]]; then @@ -2585,10 +2572,11 @@ end function __perlbrew_set_path - set -l MANPATH_WITHOUT_PERLBREW (perl -e 'print join " ", grep { index($_, $ENV{PERLBREW_HOME}) < 0 } grep { index($_, $ENV{PERLBREW_ROOT}) < 0 } split/:/,qx(manpath 2> /dev/null);') + set -l MANPATH_WITHOUT_PERLBREW (perl -e 'print join ":", grep { index($_, $ENV{PERLBREW_HOME}) < 0 } grep { index($_, $ENV{PERLBREW_ROOT}) < 0 } split/:/,qx(manpath 2> /dev/null);') if test -n "$PERLBREW_MANPATH" - set -x MANPATH $PERLBREW_MANPATH $MANPATH_WITHOUT_PERLBREW + set -l PERLBREW_MANPATH $PERLBREW_MANPATH":" + set -x MANPATH {$PERLBREW_MANPATH}{$MANPATH_WITHOUT_PERLBREW} else set -x MANPATH $MANPATH_WITHOUT_PERLBREW end @@ -2604,7 +2592,7 @@ end function __perlbrew_set_env - set -l code (eval $perlbrew_command env $argv | perl -pe 's/export\s+(\S+)="(\S*)"/set -x $1 $2;/g; y/:/ /') + set -l code (eval $perlbrew_command env $argv | perl -pe 's/^(export|setenv)/set -xg/; s/^unset[env]*/set -eug/; s/$/;/; y/:/ /') if test -z "$code" return 0; @@ -2682,7 +2670,7 @@ end function __source_init - perl -pe's/^export/set -x/; s/=/ /; s/$/;/;' "$PERLBREW_HOME/init" | . - + perl -pe's/^\(export|setenv\)/set -xg/; s/=/ /; s/$/;/;' "$PERLBREW_HOME/init" | . - end if test -z "$PERLBREW_ROOT" @@ -3051,7 +3039,7 @@ =head1 COPYRIGHT -Copyright (c) 2010,2011,2012,2013,2014 Kang-min Liu C<< <gu...@gugod.org> >>. +Copyright (c) 2010,2011,2012,2013,2014,2015 Kang-min Liu C<< <gu...@gugod.org> >>. =head1 LICENCE diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/App-perlbrew-0.71/t/command-exec.t new/App-perlbrew-0.73/t/command-exec.t --- old/App-perlbrew-0.71/t/command-exec.t 2014-09-05 20:56:01.000000000 +0200 +++ new/App-perlbrew-0.73/t/command-exec.t 2015-02-01 10:07:22.000000000 +0100 @@ -149,6 +149,17 @@ format_info_output_value OUT }; + it "should be quiet if asked" => sub { + my $app = App::perlbrew->new(qw(exec --quiet --with), "perl-5.14.1", qw(perl -E), "somesub 42"); + $app->expects("format_info_output")->exactly(0)->returns('should not be called!'); + App::perlbrew->expects("do_exit_with_error_code")->exactly(1)->returns(sub { + die "simulate exit\n"; + }); + $app->expects("do_system_with_exit_code")->exactly(1)->returns(7<<8); + stderr_is sub { + eval { $app->run; 1; }; + }, ''; + }; it "should format info output for right perl" => sub { my $app = App::perlbrew->new(qw(exec --with), "perl-5.14.1", qw(perl -E), "somesub 42"); $app->expects("format_info_output")->exactly(1)->returns(sub { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/App-perlbrew-0.71/t/command-lib.t new/App-perlbrew-0.73/t/command-lib.t --- old/App-perlbrew-0.71/t/command-lib.t 2014-09-05 20:56:01.000000000 +0200 +++ new/App-perlbrew-0.73/t/command-lib.t 2015-02-01 10:07:22.000000000 +0100 @@ -16,11 +16,20 @@ mock_perlbrew_install("perl-5.14.3"); describe "lib command," => sub { - it "shows a page of usage synopsis when no sub-command are given." => sub { - stdout_like { - App::perlbrew->new("lib")->run; - - } qr/usage/i; + describe "when invoked with unknown action name,", sub { + it "should display error" => sub { + my $x = "correcthorsebatterystaple"; + my $app = App::perlbrew->new("lib", $x); + stdout_like { + eval { + $app->run; + 1; + } + or do { + print STDERR $@; + }; + } qr/Unknown command: $x/; + } }; describe "without lib name" => sub { ++++++ cpanspec.yml ++++++ --- #description_paragraphs: 3 #no_testing: broken upstream #sources: # - source1 # - source2 #patches: # foo.patch: -p1 # bar.patch: preamble: |- BuildRequires: groff BuildRequires: wget #post_prep: |- # hunspell=`pkg-config --libs hunspell | sed -e 's,-l,,; s, *,,g'` # sed -i -e "s,hunspell-X,$hunspell," t/00-prereq.t Makefile.PL #post_install: |- # sed on %{name}.files #license: SUSE-NonFree #skip_noarch: 1 #custom_build: - #./Build build flags=%{?_smp_mflags} --myflag