Subject: | CPAN.pm shell aborts without error message when trying to delete current directory |
Module: CPAN VERSION 1.59_54
$ perl -v
This is perl, v5.6.1 built for cygwin-multi
Operating environment: cygwin version 1.3.9
When cpan shell tries to clean up it's path, if the current working directory happens to be one of the cpan cache directories that the shell is trying to clean up, the shell aborts without an error message and doesn't clean up the lock file.
--------------
For example:
### NOTE: current directory is in the cpan cache and happens to be one that cpan is going to try to kill
turnbullw@TURNBULL ~/.cpan/build/Math-Pari-2.010201
$ cpan
cpan shell -- CPAN exploration and modules installation (v1.59_54)
ReadLine support enabled
Show quoted text
cpan> install Net::SSH::Perl
CPAN: Storable loaded ok
Going to read /home/rhet/.cpan/Metadata
Database was generated on Fri, 01 Mar 2002 10:41:04 GMT
CPAN: LWP::UserAgent loaded ok
Fetching with LWP:
ftp://cpan.nas.nasa.gov/pub/perl/CPAN/authors/01mailrc.txt.gz
Going to read /home/rhet/.cpan/sources/authors/01mailrc.txt.gz
CPAN: Compress::Zlib loaded ok
Fetching with LWP:
ftp://cpan.nas.nasa.gov/pub/perl/CPAN/modules/02packages.details.txt.gz
Going to read /home/rhet/.cpan/sources/modules/02packages.details.txt.gz
Database was generated on Mon, 04 Mar 2002 07:19:56 GMT
Fetching with LWP:
ftp://cpan.nas.nasa.gov/pub/perl/CPAN/modules/03modlist.data.gz
Going to read /home/rhet/.cpan/sources/modules/03modlist.data.gz
Going to write /home/rhet/.cpan/Metadata
Running install for module Net::SSH::Perl
Running make for B/BT/BTROTT/Net-SSH-Perl-1.23.tar.gz
CPAN: MD5 loaded ok
Checksum for /home/rhet/.cpan/sources/authors/id/B/BT/BTROTT/Net-SSH-Perl-1.23.tar.gz ok
Scanning cache /home/rhet/.cpan/build for sizes
Deleting from cache: /home/rhet/.cpan/build/Math-Pari-2.010201 (34.1>10.0 MB)
### NOTE: ^^^ That's where cpan shell aborted
turnbullw@TURNBULL ~/.cpan/build/Math-Pari-2.010201
$ cpan
There seems to be running another CPAN process (1656). Contacting...
Other job not responding. Shall I overwrite the lockfile? (Y/N) [y] n
Ok, bye
---------------
I think I've traced the culprit to line 869 of CPAN.pm which is this line
File::Path::rmtree($dir);
in sub force_clean_cache
Apparently File::Path::rmtree aborts without an error message if it can't delete the current directory. After looking at File::Path, I think that ultimately this is really a bug with the rmdir function of this version of perl under cygwin. If rmdir is called on the current directory then perl 5.6.1 under cygwin aborts without an error message. Under ActiveState perl 5.6.1, I get:
C:\temp\foo2>perl -e "rmdir 'c:\temp\foo2' or die $!; print 'ok'"
Permission denied at -e line 1.
Under cygwin perl 5.6.1 I get:
turnbullw@TURNBULL /tmp/foo
$ perl -e'rmdir "/tmp/foo2" or die "dead: $!"; print "ok"'
turnbullw@TURNBULL /tmp/foo2
Notice that it just aborts.
I will report this to the cygwin and perlbug lists but since it can cause CPAN.pm to fail I thought I should report it here as well.
Regards,
Rhet Turnbull