Ken Williams wrote:

On Nov 19, 2007, at 8:54 AM, John E. Malmberg wrote:

The Cwd.pm in blead is different than CPAN right now for VMS,


Actually I just compared, and it looks like the 3.25_01 release of PathTools never got integrated into blead. Is that a desirable thing to do? From my perspective it would be (it's more stable and has more consistent results across platforms), but I'm not sure what the status of the code freeze is.

We could call it 3.26 if desired.

I just copied the portions that would affect VMS over my working copy of blead.

The _cwd() code in Unix.pm needs a VMS specific change that I have not had time to implement and test. It needs to call VMS::Filespec::unixpath() on the result to force it into UNIX syntax on VMS. Without this, File::Spec::Unix->rel2abs() can not be used on VMS, and modules in Core tend to assume that it will.

where the CPAN copy will return a valid filename that is not really the primary absolute path as is done on Unix. The existing Cwd.pm VMS code in blead has a bug where it assumes that the current working directory is correct for the contents of the symbolic link.

The patches (in modified form) have been committed to http:// svn.perl.org/modules/PathTools/trunk , want to take a look and make sure everything looks okay?

cwd.t in the svn.perl.org/Modules/PathTools/trunk is wrong. The attached patch is needed.

VMS requires the symbolic link target to be in UNIX format, or it will not work properly.

This probably needs to be documented in the pod for symlink().

Making this change pretty much reverts the rest of the test to what it was before with two changes:

1. The start directory delimiter needs to be removed to do a directory compare.

2. The file compare needs to be case insensitive on VMS or other case insensitive file systems that do not preserve case. (apparently there isn't any others)

Post 5.10 release I plan to be working on getting pathtools to understand ODS-5 file specifications on VMS. In order to do that correctly, I have to expose the DECC feature settings, so that the pathtools behavior will match what the environment on VMS has been set up to be.

I wanted to get blead-perl more stable before doing that so that I could be sure that those changes did not introduce additional problems.

-John
--- ext/Cwd/t/cwd.t_new Sun Nov 25 16:55:58 2007
+++ ext/Cwd/t/cwd.t     Sun Nov 18 01:41:16 2007
@@ -135,11 +135,16 @@
 # Cwd::chdir should also update $ENV{PWD}
 dir_ends_with( $ENV{PWD}, $Test_Dir, 'Cwd::chdir() updates $ENV{PWD}' );
 my $updir = File::Spec->updir;
-
-for ([EMAIL PROTECTED]) {
-  Cwd::chdir $updir;
-  print "#$ENV{PWD}\n";
-}
+Cwd::chdir $updir;
+print "#$ENV{PWD}\n";
+Cwd::chdir $updir;
+print "#$ENV{PWD}\n";
+Cwd::chdir $updir;
+print "#$ENV{PWD}\n";
+Cwd::chdir $updir;
+print "#$ENV{PWD}\n";
+Cwd::chdir $updir;
+print "#$ENV{PWD}\n";
 
 rmtree($test_dirs[0], 0, 0);
 
@@ -163,20 +168,26 @@
 SKIP: {
     skip "no symlinks on this platform", 2+$EXTRA_ABSPATH_TESTS unless 
$Config{d_symlink};
 
-    my $file = "linktest";
     mkpath([$Test_Dir], 0, 0777);
-    symlink $Test_Dir, $file;
 
-    my $abs_path      =  Cwd::abs_path($file);
-    my $fast_abs_path =  Cwd::fast_abs_path($file);
-    my $want          =  quotemeta( File::Spec->rel2abs($Test_Dir) );
+    # VMS require symbolic link targets to be in UNIX format
+    $Test_Dir = VMS::Filespec::unixify($Test_Dir) if $^O eq 'VMS';
+
+    symlink $Test_Dir, "linktest";
+
+    my $abs_path      =  Cwd::abs_path("linktest");
+    my $fast_abs_path =  Cwd::fast_abs_path("linktest");
+    my $want          =  File::Spec->catdir("t", $Test_Dir);
+
+    # Need to remove start directory delimiters for path compares on VMS
+    $want =~ s/\[// if $^O eq 'VMS';
 
     like($abs_path,      qr|$want$|i);
     like($fast_abs_path, qr|$want$|i);
-    like(Cwd::_perl_abs_path($file), qr|$want$|i) if $EXTRA_ABSPATH_TESTS;
+    like(Cwd::_perl_abs_path("linktest"), qr|$want$|i) if $EXTRA_ABSPATH_TESTS;
 
     rmtree($test_dirs[0], 0, 0);
-    1 while unlink $file;
+    1 while unlink "linktest";
 }
 
 if ($ENV{PERL_CORE}) {

Reply via email to