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.

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.

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.

-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" );

Reply via email to