Skip Menu |
 

This queue is for tickets about the CPAN CPAN distribution.

Report information
The Basics
Id: 42910
Status: new
Priority: 0/
Queue: CPAN

People
Owner: Nobody in particular
Requestors: wyant [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 1.9301
Fixed in: (no value)



Subject: CPAN doesn't quote downloaded file names
MIME-Version: 1.0
X-Mailer: MIME-tools 5.427 (Entity 5.427)
Charset: utf8
X-RT-Original-Encoding: utf-8
Content-Type: multipart/mixed; boundary="----------=_1233283214-29719-719"
Content-Length: 0
Content-Type: text/plain
Content-Disposition: inline
Content-Transfer-Encoding: binary
Content-Length: 717
Download (untitled) / with headers
text/plain 717b
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
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="----------=_1233283213-29719-718"
X-Mailer: MIME-tools 5.427 (Entity 5.427)
Charset: utf8
Content-Length: 0
Content-Type: text/plain
Content-Disposition: inline
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: iso-8859-1
Content-Length: 0
Content-Type: application/octet-stream; name="CPAN.patch"
Content-Disposition: inline; filename="CPAN.patch"
Content-Transfer-Encoding: base64
Content-Length: 776
Download CPAN.patch
text/x-diff 776b
--- /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';


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.