From: Michael G Schwern Date: Mon, 11 Jul 2005 23:24:56 +0000 (-0700) Subject: [perl #24119] CPAN.pm error in Win32: uses rename() not File::Copy::move X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=f9b810e81bd9e67dc80d00836f36e8d03c9021f2;p=p5sagit%2Fp5-mst-13.2.git [perl #24119] CPAN.pm error in Win32: uses rename() not File::Copy::move From: "Michael G Schwern via RT" Message-ID: p4raw-id: //depot/perl@25125 --- diff --git a/lib/CPAN.pm b/lib/CPAN.pm index fd184b2..6a2075b 100644 --- a/lib/CPAN.pm +++ b/lib/CPAN.pm @@ -3948,9 +3948,9 @@ sub get { -d $packagedir and $CPAN::Frontend->myprint("Removing previously used ". "$packagedir\n"); File::Path::rmtree($packagedir); - rename($distdir,$packagedir) or - Carp::confess("Couldn't rename $distdir to $packagedir: $!"); - $self->debug(sprintf("renamed distdir[%s] to packagedir[%s] -e[%s]-d[%s]", + File::Copy::move($distdir,$packagedir) or + Carp::confess("Couldn't move $distdir to $packagedir: $!"); + $self->debug(sprintf("moved distdir[%s] to packagedir[%s] -e[%s]-d[%s]", $distdir, $packagedir, -e $packagedir, @@ -3971,7 +3971,7 @@ sub get { my($f); for $f (@readdir) { # is already without "." and ".." my $to = File::Spec->catdir($packagedir,$f); - rename($f,$to) or Carp::confess("Couldn't rename $f to $to: $!"); + File::Copy::move($f,$to) or Carp::confess("Couldn't move $f to $to: $!"); } } if ($CPAN::Signal){