I'm trying to write up simple copy-n-paste instructions for developers to
use to build their own local development environment using local::lib.
I install local::lib, and that installs an updated version of CPAN, but the
urllist ends up empty. Seems in the past that when I did this CPAN was set
up to a default urllist and basically worked out-of-the-box.
Do I need to explicitly set the urllist or am I doing this incorrectly here.
Again, the goal is to provide simple instructions that almost anyone can
follow to set up a dev environment.
For example (with current version of local::lib):
wget
http://search.cpan.org/CPAN/authors/id/G/GE/GETTY/local-lib-1.006005.tar.gz
tar zxof local-lib-1.006005.tar.gz
cd local-lib-1.006005
perl Makefile.PL --bootstrap
make test && make install
echo 'eval $(perl -I$HOME/perl5/lib/perl5 -Mlocal::lib)' >>~/.bashrc
. ~/.bashrc
cd
Now, one thing I notice is I get this when running the --bootstrap:
Attempting to create directory /home/bill/perl5
Attempting to create file /home/bill/perl5/.modulebuildrc
CPAN version 1.82 required--this is only version 1.7602.
BEGIN failed--compilation aborted.
/home/bill/.cpan/CPAN/MyConfig.pm initialized.
But it continues to auto-config CPAN and then an updated CPAN is fetched and
installed.
CPAN.pm: Going to build A/AN/ANDK/CPAN-1.9402.tar.gz
Which then re-runs the config for missing new parameters.
The odd thing is once this is all done if I run the cpan shell and list the
confg ("o conf") the urllist configuration is *empty*. So, if I then try
and install a module I get an error (see below).
It must of had a urllist in the first place to grab CPAN, no? Did the
reconfigure of cpan (after it downloaded the new CPAN) destroy the list?
The basic question is what instructions should I give to (perhaps new) Perl
developers to set up their local environment?
cpan[1]> install Module::Install
CPAN: Storable loaded ok (v2.18)
Going to read '/home/bill/.cpan/Metadata'
Database was generated on Tue, 27 Jul 2010 11:27:01 GMT
Running install for module 'Module::Install'
Running make for A/AD/ADAMK/Module-Install-1.00.tar.gz
CPAN: Time::HiRes loaded ok (v1.9715)
Warning: no success downloading
'/home/bill/.cpan/sources/authors/id/A/AD/ADAMK/Module-Install-1.00.tar.gz.tmp21253'.
Giving up on it. at /home/bill/perl5/lib/perl5/CPAN/FTP.pm line 837
CPAN::FTP::hostdlhard('CPAN::FTP', 'ARRAY(0x851bbb8)',
'authors/id/A/AD/ADAMK/Module-Install-1.00.tar.gz',
'/home/bill/.cpan/sources/authors/id/A/AD/ADAMK/Module-Install...',
'HASH(0xc4c52c8)') called at /home/bill/perl5/lib/perl5/CPAN/FTP.pm line 515
CPAN::FTP::hostdlxxx('CPAN::FTP', 'dlhard', 'undef',
'ARRAY(0x851bbb8)', 'authors/id/A/AD/ADAMK/Module-Install-1.00.tar.gz',
'/home/bill/.cpan/sources/authors/id/A/AD/ADAMK/Module-Install...',
'HASH(0xc4c52c8)') called at /home/bill/perl5/lib/perl5/CPAN/FTP.pm line 442
CPAN::FTP::localize('CPAN::FTP',
'authors/id/A/AD/ADAMK/Module-Install-1.00.tar.gz',
'/home/bill/.cpan/sources/authors/id/A/AD/ADAMK/Module-Install...') called
at /home/bill/perl5/lib/perl5/CPAN/Distribution.pm line 379
CPAN::Distribution::get_file_onto_local_disk('CPAN::Distribution=HASH(0xc2bf3e4)')
called at /home/bill/perl5/lib/perl5/CPAN/Distribution.pm line 343
CPAN::Distribution::get('CPAN::Distribution=HASH(0xc2bf3e4)') called
at /home/bill/perl5/lib/perl5/CPAN/Distribution.pm line 1677
CPAN::Distribution::make('CPAN::Distribution=HASH(0xc2bf3e4)')
called at /home/bill/perl5/lib/perl5/CPAN/Distribution.pm line 2876
CPAN::Distribution::test('CPAN::Distribution=HASH(0xc2bf3e4)')
called at /home/bill/perl5/lib/perl5/CPAN/Distribution.pm line 3266
CPAN::Distribution::install('CPAN::Distribution=HASH(0xc2bf3e4)')
called at /home/bill/perl5/lib/perl5/CPAN/Module.pm line 474
eval {...} called at /home/bill/perl5/lib/perl5/CPAN/Module.pm line
473
CPAN::Module::rematein('CPAN::Module=HASH(0xb794c3c8)', 'install')
called at /home/bill/perl5/lib/perl5/CPAN/Module.pm line 576
CPAN::Module::install('CPAN::Module=HASH(0xb794c3c8)') called at
/home/bill/perl5/lib/perl5/CPAN/Shell.pm line 1755
CPAN::Shell::rematein('CPAN::Shell', 'install', 'Module::Install')
called at /home/bill/perl5/lib/perl5/CPAN/Shell.pm line 1935
CPAN::Shell::__ANON__('CPAN::Shell', 'Module::Install') called at
/home/bill/perl5/lib/perl5/CPAN.pm line 375
eval {...} called at /home/bill/perl5/lib/perl5/CPAN.pm line 372
CPAN::shell() called at /home/bill/perl5/bin/cpan line 198
Client not fully configured, please proceed with configuring.
You have not configured a urllist and do not allow connections to the
internet to get a list of mirrors. If you wish to get a list of CPAN
mirrors to pick from, use this command
o conf init connect_to_internet_ok urllist
If you do not wish to get a list of mirrors and would prefer to set
your urllist manually, use just this command instead
o conf init urllist
cpan[2]> o conf init connect_to_internet_ok urllist
If you have never defined your own C<urllist> in your configuration
then C<CPAN.pm> will be hesitant to use the built in default sites for
downloading. It will ask you once per session if a connection to the
internet is OK and only if you say yes, it will try to connect. But to
avoid this question, you can choose your favorite download sites once
and get away with it. Or, if you have no favorite download sites
answer yes to the following question.
<connect_to_internet_ok>
If no urllist has been chosen yet, would you prefer CPAN.pm to connect
to the built-in default sites without asking? (yes/no)? [no] yes
You have no /home/bill/.cpan/sources/MIRRORED.BY
I'm trying to fetch one
Warning: no success downloading
'/home/bill/.cpan/sources/MIRRORED.BY.tmp21253'. Giving up on it. at
/home/bill/perl5/lib/perl5/CPAN/FTP.pm line 837
CPAN::FTP::hostdlhard('CPAN::FTP', 'ARRAY(0x851bbb8)', 'MIRRORED.BY',
'/home/bill/.cpan/sources/MIRRORED.BY.tmp21253', 'HASH(0xc4f87c4)') called
at /home/bill/perl5/lib/perl5/CPAN/FTP.pm line 515
CPAN::FTP::hostdlxxx('CPAN::FTP', 'dlhard', 'undef',
'ARRAY(0x851bbb8)', 'MIRRORED.BY',
'/home/bill/.cpan/sources/MIRRORED.BY.tmp21253', 'HASH(0xc4f87c4)') called
at /home/bill/perl5/lib/perl5/CPAN/FTP.pm line 442
CPAN::FTP::localize('CPAN::FTP', 'MIRRORED.BY',
'/home/bill/.cpan/sources/MIRRORED.BY', 3) called at
/home/bill/perl5/lib/perl5/CPAN/FirstTime.pm line 1424
CPAN::FirstTime::conf_sites() called at
/home/bill/perl5/lib/perl5/CPAN/FirstTime.pm line 1151
CPAN::FirstTime::init('/home/bill/.cpan/CPAN/MyConfig.pm', 'args',
'ARRAY(0x821be5c)') called at
/home/bill/perl5/lib/perl5/CPAN/HandleConfig.pm line 577
CPAN::HandleConfig::load('CPAN::HandleConfig', 'doit', 1, 'args',
'ARRAY(0x821be5c)') called at
/home/bill/perl5/lib/perl5/CPAN/HandleConfig.pm line 440
CPAN::HandleConfig::init('CPAN::HandleConfig', 'args',
'ARRAY(0x821be5c)') called at
/home/bill/perl5/lib/perl5/CPAN/HandleConfig.pm line 126
CPAN::HandleConfig::edit('CPAN::HandleConfig', 'init',
'connect_to_internet_ok', 'urllist') called at
/home/bill/perl5/lib/perl5/CPAN/Shell.pm line 393
CPAN::Shell::o('CPAN::Shell', 'conf', 'init',
'connect_to_internet_ok', 'urllist') called at
/home/bill/perl5/lib/perl5/CPAN.pm line 375
eval {...} called at /home/bill/perl5/lib/perl5/CPAN.pm line 372
CPAN::shell() called at /home/bill/perl5/bin/cpan line 198
Client not fully configured, please proceed with configuring.
You have not configured a urllist for CPAN mirrors. Configure it with
o conf init urllist
--
Bill Moseley
[email protected]