Subject: | CPAN doesn't quote downloaded file names |
When CPAN has to fall back to spawning commands to download a distro, it
fails to quote the output file name. This fails if the CPAN directory
names have spaces in them. This is particularly annoying under Mac OS X,
where the default location is '~/Library/Application Support/.cpan' (see
RT 32841).
The attached patch attempts to fix the problem the same way possible
quotes are dealt with in $url in line 4547. That is, it slaps double
quotes around possible offenders.
The attached .patch file was developed against CPAN 1.9301. If this
problem has been fixed in 1.93_02 it was done in some non-obvious (but
presumably better) way. I do not have access to 2.00.
Thank you for your time and attention.
Tom Wyant
Subject: | CPAN.patch |
--- /usr/local/lib/perl5/5.10.0/CPAN.old 2008-10-13 15:23:22.000000000 -0400
+++ /usr/local/lib/perl5/5.10.0/CPAN.pm 2009-01-29 21:18:02.000000000 -0500
@@ -4519,13 +4519,13 @@
my($src_switch) = "";
my($chdir) = "";
- my($stdout_redir) = " > $asl_ungz";
+ my($stdout_redir) = " > \"$asl_ungz\"";
if ($f eq "lynx") {
$src_switch = " -source";
} elsif ($f eq "ncftp") {
$src_switch = " -c";
} elsif ($f eq "wget") {
- $src_switch = " -O $asl_ungz";
+ $src_switch = " -O \"$asl_ungz\"";
$stdout_redir = "";
} elsif ($f eq 'curl') {
$src_switch = ' -L -f -s -S --netrc-optional';