Revision history for local::lib
+1.006009 2010-12-09
+
+ - Splitted up method guess_shelltype from parts of print_environment_vars_for
+ - Updated documentation about change of use with .modulebuildrc
+
1.006008 2010-11-17
- Finally move to PERL_MB_OPT rather than using .modulebuildrc.
# Gibt die Shell Kommandos aus um die Umgebung vorzubereiten
$ perl -Mlocal::lib
- export MODULEBUILDRC=/home/username/perl/.modulebuildrc
- export PERL_MM_OPT='INSTALL_BASE=/home/username/perl'
- export PERL5LIB='/home/username/perl/lib/perl5:/home/username/perl/lib/perl5/i386-linux'
- export PATH="/home/username/perl/bin:$PATH"
+ export PERL_MB_OPT='--install_base /home/username/perl5'
+ export PERL_MM_OPT='INSTALL_BASE=/home/username/perl5'
+ export PERL5LIB='/home/username/perl5/lib/perl5/i386-linux:/home/username/perl5/lib/perl5'
+ export PATH="/home/username/perl5/bin:$PATH"
=head2 Die Bootstrapping Methode
Sitzung mit C<CMD.EXE> zu setzen, kann man folgendes kommando nutzen:
C:\>perl -Mlocal::lib
- set MODULEBUILDRC=C:\DOCUME~1\ADMINI~1\perl5\.modulebuildrc
+ set PERL_MB_OPT=--install_base C:\DOCUME~1\ADMINI~1\perl5
set PERL_MM_OPT=INSTALL_BASE=C:\DOCUME~1\ADMINI~1\perl5
set PERL5LIB=C:\DOCUME~1\ADMINI~1\perl5\lib\perl5;C:\DOCUME~1\ADMINI~1\perl5\lib\perl5\MSWin32-x86-multi-thread
set PATH=C:\DOCUME~1\ADMINI~1\perl5\bin;%PATH%
=over 4
-=item MODULEBUILDRC
+=item PERL_MB_OPT
=item PERL_MM_OPT
auf der Basis des angegebenen Pfad. Basierend auf L</install_base_perl_path>
Rückgabewert, hängt diese Methode noch C<bin> an.
-=head2 modulebuildrc_path
-
-=over 4
-
-=item Parameter: $pfad
-
-=item Rückgabewert: $modulebuildrc_pfad
-
-=back
-
-Gibt den Pfad zurück wo die C<.modulebuildrc> Datei angelegt wird, basierend
-auf der Basis des angegebenen Pfad.
-
=head2 resolve_empty_path
=over 4
Bootstrap ist leider ein Hack, und wird auf jedenfall CPAN.pm benutzen für
ExtUtils::MakeMaker, auch wenn CPANPLUS installiert ist.
-Es setzt definitiv PERL5LIB, PERL_MM_OPT und MODULEBUILDRC neu und vernichtet
+Es setzt definitiv PERL5LIB, PERL_MM_OPT und PERL_MB_OPT neu und vernichtet
jeden Wert der vorher gesetzt war.
Es sollte vielleicht eine automatische Korrektur der CPAN Config machen, wenn
# Apenas exibe alguns comandos úteis para a shell
$ perl -Mlocal::lib
- export MODULEBUILDRC=/home/username/perl/.modulebuildrc
- export PERL_MM_OPT='INSTALL_BASE=/home/username/perl'
- export PERL5LIB='/home/username/perl/lib/perl5:/home/username/perl/lib/perl5/i386-linux'
- export PATH="/home/username/perl/bin:$PATH"
+ export PERL_MB_OPT='--install_base /home/username/perl5'
+ export PERL_MM_OPT='INSTALL_BASE=/home/username/perl5'
+ export PERL5LIB='/home/username/perl5/lib/perl5/i386-linux:/home/username/perl5/lib/perl5'
+ export PATH="/home/username/perl5/bin:$PATH"
=head2 A técnica de 'bootstrapping'
do C<CMD.exe>, você pode fazer assim:
C:\>perl -Mlocal::lib
- set MODULEBUILDRC=C:\DOCUME~1\ADMINI~1\perl5\.modulebuildrc
+ set PERL_MB_OPT=--install_base C:\DOCUME~1\ADMINI~1\perl5
set PERL_MM_OPT=INSTALL_BASE=C:\DOCUME~1\ADMINI~1\perl5
set PERL5LIB=C:\DOCUME~1\ADMINI~1\perl5\lib\perl5;C:\DOCUME~1\ADMINI~1\perl5\lib\perl5\MSWin32-x86-multi-thread
set PATH=C:\DOCUME~1\ADMINI~1\perl5\bin;%PATH%
=over 4
-=item MODULEBUILDRC
+=item PERL_MB_OPT
=item PERL_MM_OPT
para essa instalação local de bibliotecas. Baseia-se no valor de retorno do
método L</install_base_perl_path>, adicionando o diretório C<bin>.
-=head2 modulebuildrc_path
-
-=over 4
-
-=item Argumentos: $caminho_do_diretorio
-
-=item Valor de Retorno: $caminho_para_modulebuildrc
-
-=back
-
-Retorna um caminho de diretório indicando onde instalar o arquivo
-C<.modulebuildrc>, baseado no caminho fornecido.
-
=head2 resolve_empty_path
=over 4
mesmo que você tenha o CPANPLUS instalado.
Destrói qualquer valor pré-existente nas variáveis de ambiente PERL5LIB,
-PERL_MM_OPT e MODULEBUILDRC.
+PERL_MM_OPT e PERL_MB_OPT.
Provavelmente deveria auto-configurar o CPAN caso isso ainda não tenha
sido feito.
use Carp ();
use Config;
-our $VERSION = '1.006008'; # 1.6.8
+our $VERSION = '1.006009'; # 1.6.9
our @KNOWN_FLAGS = qw(--self-contained);
sub INTERPOLATE_ENV () { 1 }
sub LITERAL_ENV () { 0 }
-sub print_environment_vars_for {
- my ($class, $path) = @_;
- my @envs = $class->build_environment_vars_for($path, LITERAL_ENV);
- my $out = '';
-
- # rather basic csh detection, goes on the assumption that something won't
- # call itself csh unless it really is. also, default to bourne in the
- # pathological situation where a user doesn't have $ENV{SHELL} defined.
- # note also that shells with funny names, like zoid, are assumed to be
- # bourne.
+sub guess_shelltype {
my $shellbin = 'sh';
if(defined $ENV{'SHELL'}) {
my @shell_bin_path_parts = File::Spec->splitpath($ENV{'SHELL'});
}
};
}
+ return $shelltype;
+}
+
+sub print_environment_vars_for {
+ my ($class, $path) = @_;
+ my @envs = $class->build_environment_vars_for($path, LITERAL_ENV);
+ my $out = '';
+
+ # rather basic csh detection, goes on the assumption that something won't
+ # call itself csh unless it really is. also, default to bourne in the
+ # pathological situation where a user doesn't have $ENV{SHELL} defined.
+ # note also that shells with funny names, like zoid, are assumed to be
+ # bourne.
+
+ my $shelltype = $class->guess_shelltype;
while (@envs) {
my ($name, $value) = (shift(@envs), shift(@envs));
# Just print out useful shell commands
$ perl -Mlocal::lib
export PERL_MB_OPT='--install_base /home/username/perl5'
- export PERL_MM_OPT='INSTALL_BASE=/home/username/perl'
- export PERL5LIB='/home/username/perl/lib/perl5:/home/username/perl/lib/perl5/i386-linux'
- export PATH="/home/username/perl/bin:$PATH"
+ export PERL_MM_OPT='INSTALL_BASE=/home/username/perl5'
+ export PERL5LIB='/home/username/perl5/lib/perl5/i386-linux:/home/username/perl5/lib/perl5'
+ export PATH="/home/username/perl5/bin:$PATH"
=head2 The bootstrapping technique