At 3:30 PM -0500 9/3/07, John E. Malmberg wrote:
>Craig A. Berry wrote:
>> Either way, it definitely needed to be a file, not a directory, so
>>I've left it as catfile and fixed the underlying problem instead.
>
>No, it is intended to be a directory with the name indicated by "$$" The test 
>will not pass with catfile().
>
>catpath() requires a volume component, and catdir does not, so in this case 
>catdir() appears to be the right choice.
>
>The variable name is $outfile, but it really is expected to contain only a 
>path, or the call to $tar->extract_file that follows it will fail on VMS 
>because it it needs a directory.

The test passes without any changes to the test itself after my patch
to Archive::Tar::_extract_file.  As far as I can see, the test is not
testing that you can extract to a non-default directory, but is
rather testing that you can completely override the default file spec
to which the file contents will be extracted.  The pod to
extract_file says:

"Optionally takes a second parameter, which is the full native
path (including filename) the entry will be written to."

The only part of the pod I changed was to replace "(unix)" with
"native" to make it reflect what the code was actually doing.

>
>-John
>
>
>--- /rsync_root/perl/lib/Archive/Tar/t/02_methods.t    Sun May 20 07:56:42 2007
>+++ lib/Archive/Tar/t/02_methods.t     Thu Aug 30 22:27:44 2007
>@@ -732,7 +732,7 @@
>                                 )
>             ) {
> 
>-                my $outfile = File::Spec->catfile( $outpath, $$ );
>+                my $outfile = File::Spec->catdir( $outpath, $$ );
>    
>                 ok( $tar->extract_file( $file->full_path, $outfile ),
>                                 "   Extracted file '$path' to $outfile" );


-- 
________________________________________
Craig A. Berry
mailto:[EMAIL PROTECTED]

"... getting out of a sonnet is much more
 difficult than getting in."
                 Brad Leithauser

Reply via email to