Subject: | AutoInstall loads local CPAN::Config too late |
In CPANPLUS v0.042, subroutine _install_cpan, CPAN::Config is used without being loaded. This can lead to using the wrong installation directory. I fixed this with the following patch.
--- AutoInstall.pm 2003-04-21 19:04:53.000000000 -0400
+++ AutoInstall.pm 2003-04-21 19:05:01.000000000 -0400
@@ -567,6 +567,8 @@
my $installed = 0;
my %args;
+ require CPAN; CPAN::Config->load;
+
return unless _can_write(MM->catfile($CPAN::Config->{cpan_home}, 'sources')
);
# if we're root, set UNINST=1 to avoid trouble unless user asked for it.
@@ -584,8 +586,6 @@
$CPAN::Config->{$opt} = $arg;
}
- require CPAN; CPAN::Config->load;
-
while (my ($pkg, $ver) = splice(@modules, 0, 2)) {
MY::preinstall($pkg, $ver) or next if defined &MY::preinstall;
Here is my CPAN configuration:
$CPAN::Config = {
'build_cache' => q[10],
'build_dir' => q[/tmp/.g2james.cpan/build],
'cache_metadata' => q[1],
'cpan_home' => q[/tmp/.g2james.cpan],
'dontload_hash' => { },
'ftp' => q[/usr/bin/ftp],
'ftp_proxy' => q[],
'getcwd' => q[cwd],
'gzip' => q[/bin/gzip],
'http_proxy' => q[],
'inactivity_timeout' => q[0],
'index_expire' => q[1],
'inhibit_startup_message' => q[0],
'keep_source_where' => q[/tmp/.g2james.cpan/sources],
'lynx' => q[/local/bin/lynx],
'make' => q[/local/bin/make],
'make_arg' => q[],
'make_install_arg' => q[],
'makepl_arg' => q[PERL_LIB=/h/u3/g2/00/g2james/csc309/a2/lib:/local/lib/perl5/5.6.0 PERL_ARCHLIB=/local/lib/perl5/5.6.0/i686-linux SITELIBEXP=/h/u3/g2/00/g2james/csc309/a2/lib PREFIX=~/csc309/a2/lib INSTALLPRIVLIB=~/csc309/a2/lib INSTALLSCRIPT=~/csc309/a2/lib INSTALLSITELIB=~/csc309/a2/lib INSTALLMAN1DIR=~/man INSTALLMAN3DIR=~/man3],
'ncftpget' => q[/usr/bin/ncftpget],
'no_proxy' => q[],
'pager' => q[/usr/bin/less],
'prerequisites_policy' => q[follow],
'scan_cache' => q[atstart],
'shell' => q[/var/shell/zsh],
'tar' => q[/bin/tar],
'term_is_latin' => q[1],
'unzip' => q[/local/bin/unzip],
'urllist' => [q[ftp://cpan.chebucto.ns.ca/pub/CPAN/], q[ftp://sunsite.ualberta.ca/pub/Mirror/CPAN/], q[ftp://ftp.nrc.ca/pub/CPAN/], q[ftp://theoryx5.uwinnipeg.ca/pub/CPAN/], q[http://cpan.mirror.smartworker.org/]],
'wait_list' => [q[wait://ls6.informatik.uni-dortmund.de:1404]],
'wget' => q[/local/bin/wget],
};
1;
__END__
Here are my system specs:
werewolf /h/u3/g2/00/g2james>uname -a
Linux werewolf 2.4.18-27.7.xbigmem #1 SMP Fri Mar 14 05:08:50 EST 2003 i686 unkn
own
Summary of my perl5 (revision 5.0 version 6 subversion 0) configuration:
Platform:
osname=linux, osvers=2.2.16-3, archname=i686-linux
uname='linux kirin 2.2.16-3 #1 mon jun 19 18:10:14 edt 2000 i686 unknown '
config_args='-Dprefix=/local'
hint=recommended, useposix=true, d_sigaction=define
usethreads=undef use5005threads=undef useithreads=undef usemultiplicity=undef
useperlio=undef d_sfio=undef uselargefiles=define
use64bitint=undef use64bitall=undef uselongdouble=undef usesocks=undef
Compiler:
cc='cc', optimize='-O2', gccversion=egcs-2.91.66 19990314/Linux (egcs-1.1.2 release)
cppflags='-fno-strict-aliasing -I/usr/local/include'
ccflags ='-fno-strict-aliasing -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64'
stdchar='char', d_stdstdio=define, usevfork=false
intsize=4, longsize=4, ptrsize=4, doublesize=8
d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=12
ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8
alignbytes=4, usemymalloc=y, prototype=define
Linker and Libraries:
ld='cc', ldflags =' -L/usr/local/lib'
libpth=/usr/local/lib /lib /usr/lib
libs=-lnsl -lndbm -lgdbm -ldb -ldl -lm -lc -lposix -lcrypt
libc=/lib/libc-2.1.3.so, so=so, useshrplib=false, libperl=libperl.a
Dynamic Linking:
dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-rdynamic'
cccdlflags='-fpic', lddlflags='-shared -L/usr/local/lib'
Characteristics of this binary (from libperl):
Compile-time options: USE_LARGE_FILES
Built under linux
Compiled at Dec 20 2000 13:05:20
%ENV:
PERL5LIB="/h/u3/g2/00/g2james/csc309/a2/lib:/usr/lib/perl5/vendor_perl/5.6.1/:/usr/lib/perl5/vendor_perl/5.6.1/i386-linux:"
@INC:
/h/u3/g2/00/g2james/csc309/a2/lib
/usr/lib/perl5/vendor_perl/5.6.1/
/usr/lib/perl5/vendor_perl/5.6.1/i386-linux
/local/lib/perl5/5.6.0/i686-linux
/local/lib/perl5/5.6.0
/local/lib/perl5/site_perl/5.6.0/i686-linux
/local/lib/perl5/site_perl/5.6.0
/local/lib/perl5/site_perl
.