robertmuench.de

To the point & Out of the box


MSYS, Perl & CPAN

I’m a big fan of using the MinGW development environment. It works great and let me use mostly a Linux environment to create Windows stuff.

I just wanted to compile some code, and as usual before you can do this, you have to go through the complete dependency chain until you get what you want.

I’m a big fan of using the MinGW development environment. It works great and let me use mostly a Linux environment to create Windows stuff.

I just wanted to compile some code, and as usual before you can do this, you have to go through the complete dependency chain until you get what you want. And these dependency chains are what I really hate about using all this open-source stuff. So, this time I first got an archive that uses LZMA compression. Within this archive was a XZ archive (why the hell to people cascade compressed archives?).

So, I got these XZ tools. Now the configure script required some Perl stuff. Ok, no big deal. Fire up CPAN and get the required modules.

But that was the simple assumption I made. Somehow MSYS’ ftp program behaved very strange. It opened up a separate window, the CPAN script failed and I didn’t made any progress. After investigating all the internals, I found out that the MSYS ftp “command” is just a wrapper that fires up CMD.EXE and than the native Windows ftp command.

And this setup doesn’t work if other scripts use Unix style ftp commands. So, I searched for the MinGW ftp version. The MinGW project is hosted on sourceforge. And it has the total stupid approach to provide each file as a single file. This wouldn’t be a problem if something else than sourceforge would be used. Because the sourceforge site is total crap if you want to search for single files. This is because the folders are folded and you can’t see the single files. Showing all files doesn’t help either, because it’s not working for me.

Anyway, I finally found out, that the MingGW ftp is included in msysDTK. This is an EXE you can install on Windows that brings a bunch of necessary tools to work with MSYS/MinGW.

Ok, now back to CPAN. It failed. This seems because even the MSYS ftp is so far away from the Unix version that CPAN just doesn’t work.

Well, than let’s try to use CPAN with wget. There is a wget version for MSYS (if you wonder where it is, it’s included in the “...supplementTools” branch). Ok, wget works as expected. But to use wget with CPAN is not straight forward because the Perl genius default to ftp.

So, we need to tell CPAN to use wget. If you think this is easy, you are wrong. Here is how to do it: In file CPAN/Config.pm do the following:

Set ftp: /bin/false, and cross-check that wget is set to the path of your wget binary. And apply this patch to CPAN.pm

my($f,$funkyftp);
- for $f ('lynx','ncftpget','ncftp','wget') {
+ for $f ('wget') {
next unless exists $CPAN::Config->{$f};

Than finally I could continue with the stuff I wanted to do in the beginning. To find this out took me several hours of searching, installing and trying things out...
0 Comments