It has only recently been reported that
a perl build might have trouble on ODS-5.
Although I recall testing it a few years ago
I suspect things might have changed and I only
recently ran into the problem when extracting
perl-5.8.1-RC5.tar.gz onto an ODS-5
volume (the release kits that unpack into
perl.dir do not exhibit the problem the same
way that a perl-5^.8^.1-RC5.dir does).

Enclosed is a possible patch to several
files that in essence changes this type of
path change:

    $unixpath = $vmspath;
    $unixpath =~ s{\.}{/}g;

Into something that in effect looks a bit
more like this:

    $unixpath = $vmspath;
    $unixpath =~ s{(?<!\^)\.}{/}g;

that is, if a period along a path is preceded by
a '^' character then it is not changed to a '/'
otherwise it will be.  The enclosed patch does this
for all vms to unix and unix to vms path transforms
and it does not attempt to restrict the change to
ODS-5 only or "set proce/parse=extend" only
type environments (I think this is safe since '^'
is not allowed on ODS-2).

With this applied a test build with C<@configure "-des">
on ODS-2 returns:

All tests successful.
u=108.39  s=0  cu=0  cs=0  scripts=736  tests=75864

Whereas on an ODS-5 volume I obtain:

lib/ExtUtils/t/INST_PREFIX...........FAILED at test 2
lib/ExtUtils/t/INST..................FAILED at test 2
lib/ExtUtils/t/Manifest..............FAILED at test 24
lib/ExtUtils/t/postamble.............FAILED at test 2
lib/ExtUtils/t/recurs................FAILED at test 5
lib/ExtUtils/t/VERSION_FROM..........FAILED at test 1
lib/ExtUtils/t/writemakefile_args....FAILED at test 5
lib/File/Find/t/find.................FAILED at test 1
lib/File/Find/t/taint................FAILED at test 1
t/pod/find...........................FAILED at test 2
Failed 10 test scripts out of 736, 98.64% okay.

Hence this patch could be considered a work in progress
since I have not yet had time to consider if the tests
need changing or the patch itself needs changing:

diff -ru perl-5.8.1-RC5.orig/configure.com perl-5.8.1-RC5/configure.com
--- perl-5.8.1-RC5.orig/configure.com     2003-09-02 09:39:18.000000000 -0400
+++ perl-5.8.1-RC5/configure.com    2003-09-24 11:26:32.000000000 -0400
@@ -6217,7 +6217,8 @@
      if ($extdir =~ /^vms/i) { $extdir =~ s/vms/.vms.ext/i; }
      else                    { $extdir = ".ext.$extdir";   }
      ($ENV{'extdir'} = "[$extdir]");
-     ($ENV{'up'} = ('-') x ($extdir =~ tr/././));
+     my @d = split(  /(?<!\^)\./, $extdir );
+     ($ENV{'up'} = ('-') x ($#d));
 $    eod
 $    Set Default &extdir
 $    redesc = 0
diff -ru perl-5.8.1-RC5.orig/vms/ext/Filespec.pm perl-5.8.1-RC5/vms/ext/Filespec.pm
--- perl-5.8.1-RC5.orig/vms/ext/Filespec.pm     2003-09-18 05:21:59.000000000 -0400
+++ perl-5.8.1-RC5/vms/ext/Filespec.pm    2003-09-24 11:26:51.000000000 -0400
@@ -254,7 +254,7 @@
     $fspec = rmsexpand($fspec,'_N_O_T_:[_R_E_A_L_]');
     $fspec =~ s/.*_N_O_T_:(?:\[_R_E_A_L_\])?//;
     my($dev,$dir,$base) = $fspec =~ m#([^:<\[]*):?[<\[](.*)[>\]](.*)#;
-    my(@dirs) = split(m#\.#,$dir);
+    my(@dirs) = split(m#(?<!\^)\.#,$dir);
     if ($dirs[0] && $dirs[0] =~ /^-/) {
       my($steps) = shift @dirs;
       for (1..length($steps)) { unshift @dirs, '..'; }
diff -ru perl-5.8.1-RC5.orig/vms/vms.c perl-5.8.1-RC5/vms/vms.c
--- perl-5.8.1-RC5.orig/vms/vms.c   2003-09-02 09:42:03.000000000 -0400
+++ perl-5.8.1-RC5/vms/vms.c  2003-09-24 11:34:56.000000000 -0400
@@ -3745,6 +3745,12 @@
     else if (*cp2 == ']' || *cp2 == '>') {
       if (*(cp1-1) != '/') *(cp1++) = '/'; /* Don't double after ellipsis */
     }
+    else if (*cp2 == '^' && *(cp2+1) == '.') {
+      /* ODS-5 under "set process/parse=extend" uses ^. to escape periods in names */
+      *(cp1++) = '^';
+      *(cp1++) = '.';
+      cp2++;
+    }
     else if (*cp2 == '.') {
       *(cp1++) = '/';
       if (*(cp2+1) == ']' || *(cp2+1) == '>') {
@@ -3910,8 +3916,18 @@
     }
     else {
       if (!infront && *(cp1-1) == '-')  *(cp1++) = '.';
-      if (*cp2 == '.')      *(cp1++) = '_';
-      else                  *(cp1++) =  *cp2;
+      if ( *(cp2) == '^' && *(cp2+1) == '.' ) {
+        /* ODS-5 under "set process/parse=extend" uses ^. to escape periods in names 
*/
+     *(cp1++) = '^';
+     *(cp1++) = '.';
+     cp2++;
+      }
+      else if (*cp2 == '.') {
+     *(cp1++) = '_';
+      }
+      else {
+        *(cp1++) =  *cp2;
+      }
       infront = 1;
     }
   }
End of Patch.

And as an attachment:

(See attached file: ods5_0.patch)

Does this seem like a viable approach that should
be further pursued?  I doubt that a change like this could
make it into 5.8.1, but I don't know that for sure.

Peter Prymmer

Attachment: ods5_0.patch
Description: Binary data

Reply via email to