Skip Menu |

This queue is for tickets about the CPANPLUS CPAN distribution.

Report information
The Basics
Id: 13476
Status: rejected
Priority: 0/
Queue: CPANPLUS

People
Owner: Nobody in particular
Requestors: imacat [...] mail.imacat.idv.tw
Cc:
AdminCc:

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



Subject: Patch to Fix makemakerflags Argument Processing
Hi. I submitted a patch to fix the argument processing in IPC::Cmd. I tried to set makemakerflags with something like "PREFIX=C:\Document and Settings\user\Application Data" PREFIX="/cygdrive/c/Document and Settings/user/Application Data" and it croaks with '"PREFIX' is not a known MakeMaker parameter name. or end up with # MakeMaker ARGV: (q[PREFIX="/cygdrive/c/Document], q[and], q[Settings/user/Application], q[Data"]) PREFIX = "/cygdrive/c/Document Although I think there should also some fix in ExtUtils::MakeMaker altogether to deal with paths containing spaces, but CPANPLUS should send a good arguments list, too. This patch use the local shell backticks to split the arguments list, instead of splitting it by spaces. The rule is defined by the local shell. There is still a potential problem that arguments may not contain new line characters in this patch, but I think it is quite enough for daily use. Please tell me if there is any problem. Thank you.
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 diff -r -u CPANPLUS-0.055.orig/lib/CPANPLUS/inc/IPC/Cmd.pm CPANPLUS-0.055/lib/CPANPLUS/inc/IPC/Cmd.pm - --- CPANPLUS-0.055.orig/lib/CPANPLUS/inc/IPC/Cmd.pm Tue Feb 22 22:14:12 2005 +++ CPANPLUS-0.055/lib/CPANPLUS/inc/IPC/Cmd.pm Wed Jun 29 10:25:08 2005 @@ -149,7 +149,7 @@ @command = map { if( /[<>|&]/ ) { $special_chars++; $_; } else { - - [ split / +/ ] + [ split "\n", join "", `perl -e "print join '\n', \@ARGV;" $_` ] } } split( /\s*([<>|&])\s*/, $cmd ); } -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.1 (GNU/Linux) iD8DBQFCw3Izi9gubzC5S1wRAs19AJ4uRwNASv4phXB+g2WiK2VafPNCxgCfW3tb iztJaBSrR/Yc96vFDpu4Hcw= =BezX -----END PGP SIGNATURE-----
[IMACAT - Thu Jun 30 00:35:27 2005]: Show quoted text
> Hi. I submitted a patch to fix the argument processing in IPC::Cmd. > I tried to set makemakerflags with something like > > "PREFIX=C:\Document and Settings\user\Application Data" > PREFIX="/cygdrive/c/Document and Settings/user/Application Data" > > and it croaks with > > '"PREFIX' is not a known MakeMaker parameter name. > > or end up with > > # MakeMaker ARGV: (q[PREFIX="/cygdrive/c/Document], q[and], > q[Settings/user/Application], q[Data"]) > PREFIX = "/cygdrive/c/Document > > Although I think there should also some fix in ExtUtils::MakeMaker > altogether to deal with paths containing spaces, but CPANPLUS > should send a good arguments list, too. > > This patch use the local shell backticks to split the arguments list, > instead of splitting it by spaces. The rule is defined by the > local shell. There is still a potential problem that arguments may > not contain new line characters in this patch, but I think it is > quite enough for daily use. > > Please tell me if there is any problem. Thank you.
Thanks for the patch. There's 2 issues with it though that makes me not able to apply it. --- CPANPLUS-0.055.orig/lib/CPANPLUS/inc/IPC/Cmd.pm Tue Feb 22 22:14:12 2005 +++ CPANPLUS-0.055/lib/CPANPLUS/inc/IPC/Cmd.pm Wed Jun 29 10:25:08 2005 @@ -149,7 +149,7 @@ @command = map { if( /[<>|&]/ ) { $special_chars++; $_; } else { - - [ split / +/ ] + [ split "\n", join "", `perl -e "print join '\n', \@ARGV;" $_` ] } } split( /\s*([<>|&])\s*/, $cmd ); First of all you use 'perl' as the command to execute.. this should be $^X. easily fixable, but the more important issue is the one of quoting; " works on Win32 and possibly VMS (maybe some other OS's, i dont know) but not on unix, there we need ', which doesnt work on Win32. So this fix, regardless of which we choose will break at least one platform. We'd need some way to reliably quote this to have it apply. In the meantime, i suggest you use the win32 shortname instead of a path with spaces (as is what i belive the installer suggests) to make sure no whitespace issues occur.
From: imacat
[KANE - Wed Jul 27 16:10:01 2005]: Show quoted text
> First of all you use 'perl' as the command to execute.. this should be > $^X. easily fixable, > but the more important issue is the one of quoting; " works on Win32 > and possibly VMS > (maybe some other OS's, i dont know) but not on unix, there we need ', > which doesnt work > on Win32.
Ah??? No. Why? " works on bash, zsh, tcsh and other unix shells. That's why I choose it. ' doesn't work on MSWin32. I'm using that patch for my linux for a month. I really don't know which shell are you talking about. It works perfectly. Could you clarify which shell (or which unix) is not working? I would be more than happy to test it.
From: imacat
Sorry I forgot to log in. Please reply to this one and ignore the previous one so that I can receive your reply notification. [KANE - Wed Jul 27 16:10:01 2005]: Show quoted text
> but the more important issue is the one of quoting; " works on Win32 > and possibly VMS > (maybe some other OS's, i dont know) but not on unix, there we need ', > which doesnt work > on Win32.
Ah??? No. Why? " works on bash, zsh, tcsh and other unix shells. That's why I choose it. ' doesn't work on MSWin32. I'm using that patch for my linux for a month. I really don't know which shell are you talking about. It works perfectly. Could you clarify which shell (or which unix) is not working? I would be more than happy to test it.
[IMACAT - Wed Jul 27 22:36:42 2005]: Show quoted text
> Sorry I forgot to log in. Please reply to this one and ignore the > previous one so that I can receive your reply notification. > > [KANE - Wed Jul 27 16:10:01 2005]:
> > but the more important issue is the one of quoting; " works on Win32 > > and possibly VMS > > (maybe some other OS's, i dont know) but not on unix, there we need ', > > which doesnt work > > on Win32.
> > Ah??? No. Why? " works on bash, zsh, tcsh and other unix shells. > That's why I choose it. ' doesn't work on MSWin32. I'm using that > patch for my linux for a month. I really don't know which shell are you > talking about. It works perfectly. > > Could you clarify which shell (or which unix) is not working? I > would be more than happy to test it.
Argh, i see now i'm not the last one to follow up on this -- very sorry about that :( using " allows for interpolation, where as ' doesn't.. so all characters that can be construed as 'special' by the shell will be interpolated, which can have some quite annoying side effect i'd like to avoid if at all possible