From: matthewt Date: Wed, 31 Mar 2010 18:10:38 +0000 (+0000) Subject: doc cleanup X-Git-Tag: 1.006009~34 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=d8b1a404286116345860cf4e825dd0b79077f189;p=p5sagit%2Flocal-lib.git doc cleanup git-svn-id: http://dev.catalyst.perl.org/repos/bast/local-lib/1.000/trunk@9073 bd8105ee-0ff8-0310-8827-fb3f25b6796d --- diff --git a/lib/lib/core/only.pm b/lib/lib/core/only.pm index 3f1ff49..9c7be40 100644 --- a/lib/lib/core/only.pm +++ b/lib/lib/core/only.pm @@ -17,15 +17,19 @@ lib::core::only - Remove all non-core paths from @INC to avoid site/vendor dirs use lib::core::only; # now @INC contains only the two core directories - # To get only the core directories plus the ones for the local::lib in - # scope +To get only the core directories plus the ones for the local::lib in scope: $ perl -Mlib::core::only -Mlocal::lib=~/perl5 myscript.pl +To attempt to do a self-contained build (but note this will not reliably +propagate into subprocesses, see the CAVEATS below): + + $ PERL5OPT='-Mlib::core::only -Mlocal::lib=~/perl5' cpan + =head1 DESCRIPTION lib::core::only is simply a shortcut to say "please reduce my @INC to only -the core lib and archlib directories of this perl". +the core lib and archlib (architecture-specific lib) directories of this perl". You might want to do this to ensure a local::lib contains only the code you need, or to test an L tree, or to avoid known diff --git a/lib/local/lib.pm b/lib/local/lib.pm index 51c9ba7..a917cd5 100644 --- a/lib/local/lib.pm +++ b/lib/local/lib.pm @@ -384,9 +384,6 @@ From the shell - # Install LWP and its missing dependencies to the '~/perl5' directory perl -MCPAN -Mlocal::lib -e 'CPAN::install(LWP)' - # Install LWP and *all non-core* dependencies to the 'my_lwp' directory - perl -MCPAN -Mlocal::lib=--self-contained,my_lwp -e 'CPAN::install(LWP)' - # Just print out useful shell commands $ perl -Mlocal::lib export MODULEBUILDRC=/home/username/perl/.modulebuildrc @@ -553,23 +550,9 @@ These values are then available for reference by any code after import. =head1 CREATING A SELF-CONTAINED SET OF MODULES -You can use local::lib to prepare a directory which contains a module and all -of its non-core dependencies. The C<--self-contained> option ignores any -globally installed modules when resolving dependencies, only considering -modules installed in a "local::lib" directory or provided by core Perl. - -A use-case for this feature would be to prepare to deploy a whole "stack" of -module dependencies on a new machine, even if you have copies of the same -dependencies installed globally already. - -The C<--self-contained> option should be used like this: - - # Install LWP and *all non-core* dependencies to the 'my_lwp' directory - perl -MCPAN -Mlocal::lib=--self-contained,my_lwp -e 'CPAN::install(LWP)' - -Note that some dependencies may involve C-based "XS" code even if your target -module doesn't. The issue of dealing with XS vs Pure Perl code is beyond the scope -of what local::lib provides. +See L for one way to do this - but note that +there are a number of caveats, and the best approach is always to perform a +build against a clean perl (i.e. site and vendor as close to empty as possible). =head1 METHODS