Date: Sun, 31 Jul 2005 00:05:16 EST-10EDT,10,-1,0,7200,3,-1,0,7200,3600 Subject: [UnixOS2_Archive] No. 591 ************************************************** Saturday 30 July 2005 Number 591 ************************************************** Subjects for today 1 Re: CPAN - again... : Andrew MacIntyre 2 Re: CPAN - again... : Steven Levine" 3 Re: CPAN - again... : John Poltorak 4 Re: CPAN - again... : Steven Levine" 5 Re: CPAN - again... : Steven Levine" **= Email 1 ==========================** Date: Fri, 29 Jul 2005 23:20:40 +1100 From: Andrew MacIntyre Subject: Re: CPAN - again... John Poltorak wrote: > > I've spent many hours trying to get the Perl CPAN module working without > success, and wondered if anyone else could provide a clue as to why WGET > is not retrieving files correctly. It would appear that the WGET command > line which is built up is introducing errors but I can't figure out what > is wrong. I could do with some help from any Perl gurus. Sorry I ca't help directly, but thought I should note a couple of things: - if fork() (from EMX - can't say about Knut's libc) is involved, expect problems in this sort of piped subprocess situation. The basic popen2() support is Ok, but if the code is Unix like and explicitly uses fork() I found lots of problems when porting Python. I ended up writing explicit support for maintaining multiple pipes to a subprocess, akin to code already in the Python sources for Win32. I still need to update it to support the new "subprocess" module... :-( - as I think you might have already discovered from other exercises, quoting on command lines is frequently a black art (especially with non-Unix shells). If a command invocation works when typed directly at a shell prompt, but not when synthesized programmaticly, I would expect there to be a subtle issue with quoting. To be honest, I'm surprised that Perl (or is it just CPAN?) relies on an external utility for retrieving files via HTTP. Python has support for opening files via URL in its standard library, and given Perl's ubiquity in web development I expected it would do likewise. ------------------------------------------------------------------------- Andrew I MacIntyre "These thoughts are mine alone..." E-mail: andymac at bullseye.apana.org.au (pref) | Snail: PO Box 370 andymac at pcug.org.au (alt) | Belconnen ACT 2616 Web: http://www.andymac.org/ | Australia **= Email 2 ==========================** Date: Fri, 29 Jul 2005 11:44:09 -0700 From: "Steven Levine" Subject: Re: CPAN - again... In <20050729104857.B56731 at warpix.org>, on 07/29/05 at 10:48 AM, John Poltorak said: >I've spent many hours trying to get the Perl CPAN module working without >success, and wondered if anyone else could provide a clue as to why WGET >is not retrieving files correctly. It would appear that the WGET command >line which is built up is introducing errors but I can't figure out what >is wrong. I could do with some help from any Perl gurus. As always, if you want others to be able to help you, you need to provide at least an example of the command line you are using along with the error messages this generates. Steven -- ---------------------------------------------------------------------- "Steven Levine" MR2/ICE 2.67 #10183 Warp4.something/14.100c_W4 www.scoug.com irc.fyrelizard.com #scoug (Wed 7pm PST) ---------------------------------------------------------------------- **= Email 3 ==========================** Date: Fri, 29 Jul 2005 22:09:07 +0100 From: John Poltorak Subject: Re: CPAN - again... On Fri, Jul 29, 2005 at 11:44:09AM -0700, Steven Levine wrote: > In <20050729104857.B56731 at warpix.org>, on 07/29/05 > at 10:48 AM, John Poltorak said: > > >I've spent many hours trying to get the Perl CPAN module working without > >success, and wondered if anyone else could provide a clue as to why WGET > >is not retrieving files correctly. It would appear that the WGET command > >line which is built up is introducing errors but I can't figure out what > >is wrong. I could do with some help from any Perl gurus. > > As always, if you want others to be able to help you, you need to provide > at least an example of the command line you are using along with the error > messages this generates. There is no error msg, it's just that retrieved files get screwed up. I have a feeling that it is something to do with incorrect line termination but have no way of confirming it. > Steven > > -- > ---------------------------------------------------------------------- > "Steven Levine" MR2/ICE 2.67 #10183 Warp4.something/14.100c_W4 > www.scoug.com irc.fyrelizard.com #scoug (Wed 7pm PST) > ---------------------------------------------------------------------- > -- John **= Email 4 ==========================** Date: Fri, 29 Jul 2005 14:50:17 -0700 From: "Steven Levine" Subject: Re: CPAN - again... In <42EA1F18.1070105 at bullseye.apana.org.au>, on 07/29/05 at 11:20 PM, Andrew MacIntyre said: >To be honest, I'm surprised that Perl (or is it just CPAN?) relies on an >external utility for retrieving files via HTTP. Python has support for >opening files via URL in its standard library, and given Perl's ubiquity >in web development I expected it would do likewise. CPAN supports a number of fetch mechanisms. The preferred method is Net::FTP which seems to work fine here. John must not have Net::FTP installed or it is failing to connect. My reading of CPAN.pm says wget is only used as a fail back. Regards, Steven -- ---------------------------------------------------------------------- "Steven Levine" MR2/ICE 2.67 #10183 Warp4.something/14.100c_W4 www.scoug.com irc.fyrelizard.com #scoug (Wed 7pm PST) ---------------------------------------------------------------------- **= Email 5 ==========================** Date: Fri, 29 Jul 2005 15:22:05 -0700 From: "Steven Levine" Subject: Re: CPAN - again... In <20050729220907.A70 at warpix.org>, on 07/29/05 at 10:09 PM, John Poltorak said: >There is no error msg, it's just that retrieved files get screwed up. That's OK, but you still need to provide command line examples. Common sense says it is best for others to try to replicate your failure rather than trying something random that might, if you are lucky, replicate your failure. It turns out you are lucky (sorta). I modified CPAN.pm line 2466 to say I did not have Net::FTP installed. This allowed me to replicate your failure. What I did was: perl -MCPAN -e shell followed by get Net::Telnet The result was a corrupted download. Net:FTP grabbed: 7-29-05 15:14 1,143 0 CHECKSUMS 7-29-05 15:14 153,600 0 Net-Telnet-3.03.tar 7-29-05 15:14 35,641 0 Net-Telnet-3.03.tar.gz which is correct, while wget grabbed: 7-29-05 15:06 1,182 0 CHECKSUMS 7-29-05 15:06 35,791 0 Net-Telnet-3.03.tar 7-29-05 15:06 35,839 0 Net-Telnet-3.03.tar.gz There appears to be a bug in wget's -O logic because wget -nd ftp://archive.progeny.com/CPAN/authors/id/J/JR/JROGERS/Net-Telnet-3.03.tar.gz and wget -O tmp.gz ftp://archive.progeny.com/CPAN/authors/id/J/JR/JROGERS/Net-Telnet-3.03.tar.gz both work just fine. while wget -O - ftp://archive.progeny.com/CPAN/authors/id/J/JR/JROGERS/Net-Telnet-3.03.tar.gz > tmp.gz generates bad news. Fixing wget is going to require contacting the wget maintainer. If you must use wget, then you need to modify CPAN.pm. Something like: $source_switch = " -O tmp.gz" and my($system) = "$chdir$funkyftp$src_switch \"$url\" $devnull && mv tmp.gz $asl_ungz"; should be sufficient. Regards, Steven -- ---------------------------------------------------------------------- "Steven Levine" MR2/ICE 2.67 #10183 Warp4.something/14.100c_W4 www.scoug.com irc.fyrelizard.com #scoug (Wed 7pm PST) ----------------------------------------------------------------------