Reconfiguring CPAN.pm

brian_d_foy on 2003-01-03T07:51:26

Tonight I re-configured my CPAN.pm, which I have been meaning to do for awhile but never got around to until I went on holiday to a place that does not get DSL, Cable, or even decent phone service. I need to add the URL to my local CPAN so I do not need the network.

To view any property I simply specify which one I want to see. In this case I want to see the list of URLs I have configured as the search path for download sites because the first one has not been working, so I might as well get rid of it while I am mucking around with the configuration. (The CPAN mirrors web site keeps track of the state of all of the public mirrors).

cpan> o conf urllist                                                               
   urllist           
        http://download.sourceforge.net/mirrors/CPAN/
        http://ftp.sedl.org/pub/mirrors/CPAN/
Type 'o conf' to view configuration edit options


To get rid of the first item in the list---the one that is not working---I shift it off. I check the value of urllist again to make sure that I got rid of it.

cpan> o conf urllist shift
cpan> o conf urllist                                                               
   urllist           
        http://ftp.sedl.org/pub/mirrors/CPAN/
Type 'o conf' to view configuration edit options


Now that the bad URL is gone, I want to add a local URL. I have kept a MINICPAN on my laptop since I got it about a month ago, and I can unshift its URL into urllist, and check again to make sure it is there.

cpan> o conf urllist unshift file:///Users/brian/MINICPAN
cpan> o conf urllist                                                               
   urllist           
        file:///Users/brian/MINICPAN
        http://ftp.sedl.org/pub/mirrors/CPAN/
Type 'o conf' to view configuration edit options


I need to test this too. I know the value is in urllist, but I usually mess up file:/// schemes, even though the CPAN.pm documentation shows mw exactly what to do in "Note on urllist parameter's format". I looked through my MINICPAN to find a module I do not have installed yet, then install it. Indeed, when I tell CPAN to install it, I see that it looks in my MINICPAN.

cpan> install Apache::SearchEngineLog                                          
CPAN: Storable loaded ok
Going to read /usr/local/src/cpan/Metadata
  Database was generated on Tue, 31 Dec 2002 20:16:56 GMT
CPAN: LWP::UserAgent loaded ok
CPAN: URI::URL loaded ok
Fetching with LWP:
  file:///Users/brian/MINICPAN/authors/01mailrc.txt.gz


Once I am satisfied, I commit the configuration data so it is the same the next time I start up CPAN.pm.

cpan> o conf commit
commit: wrote /Users/brian/.cpan/CPAN/MyConfig.pm