t/parse.t of HTML-Copy-1.23 failed as follows:
Microsoft(R) Program Maintenance Utility Version 7.00.9955
Copyright (C) Microsoft Corporation. All rights reserved.
cp lib/HTML/Copy.pm blib\lib\HTML\Copy.pm
C:\Perl\bin\perl.exe -MExtUtils::Command -e cp bin/htmlcopy
blib\script\
htmlcopy
pl2bat.bat blib\script\htmlcopy
(nmake exited with 0)
CPAN::Reporter: nmake result is 'pass', No errors.
TKURITA/HTML-Copy-1.23.tar.gz
nmake -- OK
Running make test
Microsoft(R) Program Maintenance Utility Version 7.00.9955
Copyright (C) Microsoft Corporation. All rights reserved.
C:\Perl\bin\perl.exe -MExtUtils::Command -e cp bin/htmlcopy
blib\script\
htmlcopy
pl2bat.bat blib\script\htmlcopy
C:\Perl\bin\perl.exe "-MExtUtils::Command::MM" "-
e" "test_harness(0, 'bl
ib\lib', 'blib\arch')" t/*.t
t/00-load......# Testing HTML::Copy 1.23, Perl 5.008008,
C:\Perl\bin\perl.exe
ok
t/parse........sub3460\file3460.html: No such file or directory at
C:\Perl\cpan\
build\HTML-Copy-1.23-LIUAzz\blib\lib/HTML/Copy.pm line 409
# Looks like your test died before it could output anything.
Dubious, test returned 255 (wstat 65280, 0xff00)
Failed 12/12 subtests
Test Summary Report
-------------------
t/parse.t (Wstat: 65280 Tests: 0 Failed: 0)
Non-zero exit status: 255
Parse errors: Bad plan. You planned 12 tests but ran 0.
Files=2, Tests=1, 1 wallclock secs ( 0.00 usr + 0.06 sys = 0.06 CPU)
Result: FAIL
Failed 1/2 test programs. 0/1 subtests failed.
NMAKE : fatal error U1077: 'C:\Perl\bin\perl.exe' : リターン コード
'0xff'
Stop.
(nmake test exited with 512)
-----------------------------------------------------------------------
In MSWIN32 platform, abs_path of Cwd is in fact fast_abs_path, which
uses -e file test.
Thus, the method parse_to of HTML-Copy should fail. Also, according to
the POD of Cwd,
"Since the path seperators are different on some operating systems ('/'
on Unix, ':' on MacPerl, etc...)
we recommend you use the File::Spec modules wherever portability is a
concern."
Being aware of the above, I maked a patch as follows:
--- Copy.pm.org Thu Jan 17 08:19:44 2008
+++ Copy.pm Thu Jan 17 08:41:10 2008
@@ -296,7 +296,8 @@
my $file_name = basename($self->source_path);
$destination_path = File::Spec->catfile($destination_path,
$file_name);
} else {
- mkpath(dirname($destination_path));
+ my $directories = (fileparse($destination_path))[1];
+ mkpath($directories);
}
return $self->destination_path($destination_path);
@@ -406,7 +407,7 @@
my $self = shift @_;
if (@_) {
- my $path = Cwd::abs_path(shift @_);
+ my $path = File::Spec->rel2abs(shift @_);
$self->{'destination_path'} = $path;
$self->destination_uri(URI::file->new($path));
}