Subject: | Mirroring broken on Win32 |
Hi,
I really, really like CPAN::Mini! But of course I have
a problem :-)
Symptom: minicpan correctly downloads the files, then
deletes them all. Reason: the hash $self->{mirrored} contains
the paths with backslashes, while File::Find always returns paths
with forward slashes hence the test at line 197 always fails.
The solution is straightforward (a call to canonpath).
Currently C::M downloads more than one version of the same distribution
(for example I get Wx-0.11, 12, 13, 15 and 20, and several versions of
bioperl). Would a patch to (optionally?) download only the latest
version of each distribution listed in the module list be accepted?
Thanks!
Mattia
--- lib\CPAN\Mini.pm Wed Sep 08 03:46:27 2004
+++ c:\programs\devel\perl\activeperl-5.8.4\site\lib\CPAN\Mini.pm Fri Sep 17 10:36:01 2004
@@ -52,5 +52,5 @@
use File::Path qw(mkpath);
use File::Basename qw(dirname);
-use File::Spec::Functions qw(catfile);
+use File::Spec::Functions qw(catfile canonpath);
use File::Find qw(find);
@@ -195,5 +195,5 @@
find sub {
- return unless -f and not $self->{mirrored}{$File::Find::name};
+ return unless -f and not $self->{mirrored}{canonpath($File::Find::name)};
$self->trace("$File::Find::name ... removed\n");
unlink $_ or warn "Cannot remove $File::Find::name: $!";