[Bast-commits] r6365 - in local-lib/1.000/trunk: . eg lib/local

apeiron at dev.catalyst.perl.org apeiron at dev.catalyst.perl.org
Fri May 22 01:21:34 GMT 2009


Author: apeiron
Date: 2009-05-22 01:21:33 +0000 (Fri, 22 May 2009)
New Revision: 6365

Added:
   local-lib/1.000/trunk/eg/
   local-lib/1.000/trunk/eg/scripted_install.pl
Modified:
   local-lib/1.000/trunk/Changes
   local-lib/1.000/trunk/Makefile.PL
   local-lib/1.000/trunk/lib/local/lib.pm
Log:
Clean up CPAN.pm's environment variable the same way we do for CPANPLUS. Add an
example program showing local::lib employed programmatically (confound). 
Add the beginnings of a troubleshooting section (pattern).


Modified: local-lib/1.000/trunk/Changes
===================================================================
--- local-lib/1.000/trunk/Changes	2009-05-21 23:21:55 UTC (rev 6364)
+++ local-lib/1.000/trunk/Changes	2009-05-22 01:21:33 UTC (rev 6365)
@@ -1,5 +1,12 @@
 Revision history for local::lib
 
+1.004001 2009-05-21
+        - Clean up CPAN.pm's environment variable the same way we do for
+          CPANPLUS. Add an example program showing local::lib employed
+          programmatically (confound).
+
+        - Add the beginnings of a troubleshooting section (pattern).
+
 1.004000 2009-05-14
         - Don't allow dangerous settings for CPAN.pm that affect where CPAN
           installs stuff, as this conflicts with what we're trying to do.

Modified: local-lib/1.000/trunk/Makefile.PL
===================================================================
--- local-lib/1.000/trunk/Makefile.PL	2009-05-21 23:21:55 UTC (rev 6364)
+++ local-lib/1.000/trunk/Makefile.PL	2009-05-22 01:21:33 UTC (rev 6365)
@@ -107,8 +107,10 @@
 # without this beautiful hack
 
 my $no_cpanplus_env = !exists $ENV{PERL5_CPANPLUS_IS_RUNNING};
+my $no_cpan_env = !exists $ENV{PERL5_CPAN_IS_RUNNING};
 require CPAN;
 delete $ENV{PERL5_CPANPLUS_IS_RUNNING} if $no_cpanplus_env;
+delete $ENV{PERL5_CPAN_IS_RUNNING} if $no_cpan_env;
 
 # and make sure that the user doesn't have any existing CPAN config that'll
 # cause us problems for the next few steps.

Added: local-lib/1.000/trunk/eg/scripted_install.pl
===================================================================
--- local-lib/1.000/trunk/eg/scripted_install.pl	                        (rev 0)
+++ local-lib/1.000/trunk/eg/scripted_install.pl	2009-05-22 01:21:33 UTC (rev 6365)
@@ -0,0 +1,19 @@
+#!/usr/bin/perl
+# contributed by hdp at cpan.org
+
+use strict;
+use warnings;
+use CPAN;
+use Cwd;
+use File::Spec;
+my $target = Cwd::abs_path($ENV{TARGET})
+  or die "set \$ENV{TARGET} to your desired local::lib dir\n";
+
+my $mod = CPAN::Shell->expand(Module => "local::lib");
+$mod->get;
+my $dir = CPAN::Shell->expand(Distribution => $mod->cpan_file)->dir;
+chdir($dir);
+my $make = $CPAN::Config->{make};
+system($^X, 'Makefile.PL',"--bootstrap=$target") && exit 1;
+system($make, 'test') && exit 1;
+system($make, 'install') && exit 1;

Modified: local-lib/1.000/trunk/lib/local/lib.pm
===================================================================
--- local-lib/1.000/trunk/lib/local/lib.pm	2009-05-21 23:21:55 UTC (rev 6364)
+++ local-lib/1.000/trunk/lib/local/lib.pm	2009-05-22 01:21:33 UTC (rev 6365)
@@ -11,7 +11,7 @@
 use Carp ();
 use Config;
 
-our $VERSION = '1.004000'; # 1.4.0
+our $VERSION = '1.004001'; # 1.4.1
 
 sub import {
   my ($class, @args) = @_;
@@ -586,6 +586,22 @@
 
 Patches very much welcome for any of the above.
 
+=head1 TROUBLESHOOTING
+
+If you've configured local::lib to install CPAN modules somewhere in to your
+home directory, and at some point later you try to install a module with C<cpan
+-i Foo::Bar>, but it fails with an error like: C<Warning: You do not have
+permissions to install into /usr/lib64/perl5/site_perl/5.8.8/x86_64-linux at
+/usr/lib64/perl5/5.8.8/Foo/Bar.pm> and buried within the install log is an
+error saying C<'INSTALL_BASE' is not a known MakeMaker parameter name>, then
+you've somehow lost your updated ExtUtils::MakeMaker module.
+
+To remedy this situation, rerun the bootstrapping procedure documented above.
+
+Then, run C<rm -r ~/.cpan/build/Foo-Bar*>
+
+Finally, re-run C<cpan -i Foo::Bar> and it should install without problems.
+
 =head1 ENVIRONMENT
 
 =over 4
@@ -614,9 +630,14 @@
 <torsten at raudssus.de>.
 
 Hans Dieter Pearcey <hdp at cpan.org> sent in some additional tests for ensuring
-things will install properly, and furthermore submitted a fix for the bug
-causing problems with writing Makefiles during bootstrapping. Many thanks!
+things will install properly, submitted a fix for the bug causing problems with
+writing Makefiles during bootstrapping, contributed an example program, and
+submitted yet another fix to ensure that local::lib can install and bootstrap
+properly. Many, many thanks!
 
+pattern of Freenode IRC contributed the beginnings of the Troubleshooting
+section. Many thanks!
+
 =head1 LICENSE
 
 This library is free software under the same license as perl itself




More information about the Bast-commits mailing list