At 12:10 AM -0500 8/31/07, John E. Malmberg wrote:
>This patch makes the following changes:
>
>In lib/Archive/Tar.pm, currently Perl on VMS can not fully deal with directory 
>specifications that have C<.> characters in them.  Internally the VMS.C module 
>currently translates them to C<_> characters.

I'm not seeing any Archive::Tar failures in blead, so I'd like to
know a bit more about what this patch actually fixes before applying
it.  Does it fix any of the CPANPLUS failures?  Is it necessary when
building on ODS-2 but not ODS-5?

>In the future as Perl on VMS learns how to handle this, this module will need 
>another patch, as current versions of VMS support directories with C<.> 
>characters in them.

Partial support is already there.  At least File::Spec->splitdir will
handle dots in directory names if properly escaped:

$ perl -"MFile::Spec" -e "print join qq/\n/, 
File::Spec->splitdir('[foo.bar^.baz]');"
foo
bar^.baz


>
>File::Spec on VMS can not currently handle the UNIX pathnames that are showing 
>up here, so use the UNIX routines and keep everything in UNIX syntax.  One of 
>the failures is handling empty path elements.
>
>
>In lib/Archive/Tar/t/02_methods.t, File::Spec->catfile was being used where a 
>directory path was needed.  There is a significant difference between catpath 
>and catfile on VMS, and catpath must be used if the result is intended to be a 
>path.

But you replaced catfile with catdir, not catpath.  In any case,
catfile looks right to me as it appears to be generating a file name,
not a directory name.

>-John
>[EMAIL PROTECTED]
>Personal Opinion Only
>
>
>--- /rsync_root/perl/lib/Archive/Tar.pm        Wed Aug 15 10:03:08 2007
>+++ lib/Archive/Tar.pm Thu Aug 30 23:48:31 2007
>@@ -547,9 +547,24 @@
>     ### it's a relative path ###
>     } else {
>         my $cwd     = (defined $self->{cwd} ? $self->{cwd} : cwd());
>+        $cwd = VMS::Filespec::unixify($cwd) if $^O eq 'VMS';
>         my @dirs    = File::Spec::Unix->splitdir( $dirs );
>-        my @cwd     = File::Spec->splitdir( $cwd );
>+        my @cwd;
>+        if ($^O eq 'VMS') {
>+
>+            # VMS ODS-2 can not handle dots in directory
>+            # ODS-5 can, except File::Spec::VMS does not yet know that
>+            # This will need to be changed after File::Spec::VMS is updated.
>+
>+            map tr/\./_/, @dirs;
>+
>+            # splitdir on VMS can not handle UNIX paths right now
>+            $cwd = File::Spec::Unix->splitdir( $cwd );
>+            $dir = File::Spec::Unix->catdir( @cwd, @dirs );
>+        } else {
>+            $cwd = File::Spec->splitdir( $cwd );
>         $dir        = File::Spec->catdir( @cwd, @dirs );
>+        }
> 
>         # catdir() returns undef if the path is longer than 255 chars on VMS
>         unless ( defined $dir ) {
>--- /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