Subject: | _curl_fetch problem, and CPANPLUS |
Date: | Wed, 18 Jun 2008 16:15:01 +0800 |
To: | bug-file-fetch [...] rt.cpan.org |
From: | "Michael Hamlin" <myrrhlin [...] gmail.com> |
Hi,
I was using CPAN.pm to install some modules, when it offered to
upgrade itself. I tried it, but it was badly broken after an upgrade
(I noticed it began using curl to get files instead of my preferred
ftp client, but it had other problems as well so I didn't spend long
investigating).
Instead, I downloaded and installed CPANPLUS which worked pretty well
despite some configuration issues(*). However, it failed sometimes,
like this:
CPAN Terminal> i Image::Size
Installing Image::Size (3.100001)
[ERROR] Fetching of
'ftp://ftp.cpan.org/pub/CPAN/authors/id/R/RJ/RJRAY/Image-Size-3.1.1.tar.gz'
failed: 'curl' said it fetched
'/Users/michael/.cpanplus/authors/id/R/RJ/RJRAY/Image-Size-3.1.1.tar.gz',
but it was not created
[ERROR] Fetching of
'http://www.cpan.org/authors/id/R/RJ/RJRAY/Image-Size-3.1.1.tar.gz'
failed:
[ERROR] Fetching of
'ftp://ftp.cpan.org/pub/CPAN/authors/id/R/RJ/RJRAY/CHECKSUMS' failed:
Ftp creation failed: Net::FTP: connect: Invalid argument
[ERROR] Fetching of
'http://www.cpan.org/authors/id/R/RJ/RJRAY/CHECKSUMS' failed:
Running [/opt/local/bin/perl /opt/local/bin/cpanp-run-perl
/Users/michael/.cpanplus/5.8.8/build/Image-Size-3.1.1/Makefile.PL ]...
I did some investigating on this. I believed the problem was a
.curlrc file in my home directory which specified options
(specifically -O !) that interfered with CPANPLUS, which uses
File::Fetch and tries to specify the output filename. By temporarily
renaming my .curlrc I haven't seen any further problems. I looked
into the code and found where curl is actually invoked, in your module
File::Fetch version 0.14:
831: ### these long opts are self explanatory - I like that -jmb
832: my $cmd = [ $curl ];
833:
834: push(@$cmd, '--connect-timeout', $TIMEOUT) if $TIMEOUT;
835:
836: push(@$cmd, '--silent') unless $DEBUG;
A simple solution to avoid interference with an existing .curlrc would
be to simply insert a '-q' as first option given to curl, which makes
it ignore config files, like:
833: push(@$cmd, '-q');
I hope that wouldn't break any functionality you were hoping to keep
in place (perhaps you thought to allow people to specify some options
in their own config file?). But since many curl options toggle, if
someone switches something on like --silent, and then you do as well,
then the switch is actually off again. Oops.
(*) [Unrelated] issues I had with CPANPLUS:
(1) Interface to add a mirror site was not as straightforward as
CPAN.pm. I am in China, so I needed to add the only working mirror
site in China. Even after I found "s reconfigure", it looked as
though to add a site, I would lose the five sites already in the list.
I ended up editing the configs stored in User.pm directly, once I
found it.
(2) I don't have ncftp installed, I have lftp instead. In CPAN.pm, I
simply gave the path to that lftp binary and things worked well (until
I broke CPAN.pm trying to have it upgrade itself). In CPANPLUS,
there's no easy way to use lftpget instead of ncftpget -- now I know
why, cause I found the File::Fetch code!
(3) I found an infinite loop! "s reconfigure" then choosing 1 gets me
into an infinite loop asking me two questions: "type of config file",
and "shall I overwrite it". If I don't want to change anything, I'm
stuck! Ctrl-C twice got me out. Yuck.
Thank you for great tools. Hope my time looking into this helps you
in some way.
michael