Craig A. Berry wrote:

We'll also have to fiddle with MACROSTART and MACROEND, or omit
referencing PASTHRU at all when it doesn't match \w+. Otherwise we get
what we have now, which is

The attached patch does the fiddling in both MM_Unix.pm (subdir_x) and MM_Any.pm (dist_test). I've assumed that $self->{PASTHRU} is defined and populated before any calls to dist_test() and subdir_x(), but I have not tested on any platform that actually needs the pasthru functionality. I can confirm, though, that the omission happens correctly on VMS.

The patch also modifies the test infrastructure for defining a rooted
logical. This is necessary for t/recurs.t as well as t/basic.t, but it
was only accessible to the latter. I've renamed _setup_bfd_test_root to
setup_mm_test_root and moved it to MakeMaker::Test::Utils where any test
setup routine that needs it can get to it.

After the patch, all tests pass with Perl 5.8.4 on OpenVMS Alpha V7.1
and OpenVMS Alpha V7.3-1.




--- lib/ExtUtils/MM_Any.pm;-0   Tue Feb  8 08:06:55 2005
+++ lib/ExtUtils/MM_Any.pm      Sun Feb 20 09:50:13 2005
@@ -578,11 +578,14 @@ sub dist_test {
     my($self) = shift;
 
     my $mpl_args = join " ", map qq["$_"], @ARGV;
+    my $pasthru_args = (defined($self->{PASTHRU}) && ($self->{PASTHRU} =~ 
m/\w+/)
+                       ? '$(MACROSTART)$(PASTHRU)$(MACROEND)'
+                       : '');
 
     my $test = $self->cd('$(DISTVNAME)',
                          '$(ABSPERLRUN) Makefile.PL '.$mpl_args,
-                         '$(MAKE) $(MACROSTART)$(PASTHRU)$(MACROEND)',
-                         '$(MAKE) test $(MACROSTART)$(PASTHRU)$(MACROEND)'
+                         '$(MAKE) '.$pasthru_args,
+                         '$(MAKE) test '.$pasthru_args
                         );
 
     return sprintf <<'MAKE_FRAG', $test;
--- lib/ExtUtils/MM_Unix.pm;-0  Tue Feb  8 08:06:55 2005
+++ lib/ExtUtils/MM_Unix.pm     Sun Feb 20 09:54:15 2005
@@ -3297,8 +3297,12 @@ Helper subroutine for subdirs
 sub subdir_x {
     my($self, $subdir) = @_;
 
+    my $pasthru_args = (defined($self->{PASTHRU}) && ($self->{PASTHRU} =~ 
m/\w+/)
+                       ? '$(MACROSTART)$(PASTHRU)$(MACROEND)'
+                       : '');
+
     my $subdir_cmd = $self->cd($subdir, 
-      '$(MAKE) $(USEMAKEFILE) $(FIRST_MAKEFILE) all 
$(MACROSTART)$(PASTHRU)$(MACROEND)'
+      '$(MAKE) $(USEMAKEFILE) $(FIRST_MAKEFILE) all '.$pasthru_args
     );
     return sprintf <<'EOT', $subdir_cmd;
 
--- t/lib/MakeMaker/Test/Setup/BFD.pm;-0        Sat Feb 19 12:40:30 2005
+++ t/lib/MakeMaker/Test/Setup/BFD.pm   Sun Feb 20 13:23:05 2005
@@ -7,6 +7,7 @@ require Exporter;
 use strict;
 use File::Path;
 use File::Basename;
+use MakeMaker::Test::Utils;
 
 my $Is_VMS = $^O eq 'VMS';
 
@@ -94,28 +95,9 @@ END
             );
 
 
-sub _setup_bfd_test_root {
-    if( $Is_VMS ) {
-        # On older systems we might exceed the 8-level directory depth limit
-        # imposed by RMS.  We get around this with a rooted logical, but we
-        # can't create logical names with attributes in Perl, so we do it
-        # in a DCL subprocess and put it in the job table so the parent sees 
it.
-        open( BFDTMP, '>bfdtesttmp.com' ) || 
-          die "Error creating command file; $!";
-        print BFDTMP <<'COMMAND';
-$ BFD_TEST_ROOT = 
F$PARSE("SYS$DISK:[-]",,,,"NO_CONCEAL")-".][000000"-"]["-"].;"+".]"
-$ DEFINE/JOB/NOLOG/TRANSLATION=CONCEALED BFD_TEST_ROOT 'BFD_TEST_ROOT'
-COMMAND
-        close BFDTMP;
-
-        system '@bfdtesttmp.com';
-        1 while unlink 'bfdtesttmp.com';
-    }
-}
-
 sub setup_recurs {
-    _setup_bfd_test_root();
-    chdir 'BFD_TEST_ROOT:[t]' if $Is_VMS;
+    setup_mm_test_root();
+    chdir 'MM_TEST_ROOT:[t]' if $Is_VMS;
 
     while(my($file, $text) = each %Files) {
         # Convert to a relative, native file path.
--- t/lib/MakeMaker/Test/Setup/Recurs.pm;-0     Mon Dec 20 03:17:43 2004
+++ t/lib/MakeMaker/Test/Setup/Recurs.pm        Sun Feb 20 13:23:15 2005
@@ -7,6 +7,7 @@ require Exporter;
 use strict;
 use File::Path;
 use File::Basename;
+use MakeMaker::Test::Utils;
 
 my %Files = (
              'Recurs/Makefile.PL'          => <<'END',
@@ -29,6 +30,9 @@ END
             );
 
 sub setup_recurs {
+    setup_mm_test_root();
+    chdir 'MM_TEST_ROOT:[t]' if $^O eq 'VMS';
+
     while(my($file, $text) = each %Files) {
         # Convert to a relative, native file path.
         $file = File::Spec->catfile(File::Spec->curdir, split m{\/}, $file);
--- t/lib/MakeMaker/Test/Utils.pm;-0    Mon Dec 20 03:17:43 2004
+++ t/lib/MakeMaker/Test/Utils.pm       Sun Feb 20 13:16:09 2005
@@ -13,6 +13,7 @@ $VERSION = 0.02;
 
 @EXPORT = qw(which_perl perl_lib makefile_name makefile_backup
              make make_run run make_macro calibrate_mtime
+             setup_mm_test_root
             );
 
 my $Is_VMS   = $^O eq 'VMS';
@@ -260,6 +261,32 @@ sub run {
     }
 }    
 
+=item B<setup_mm_test_root>
+
+Creates a rooted logical to avoid the 8-level limit on older VMS systems.  
+No action taken on non-VMS systems.
+
+=cut
+
+sub setup_mm_test_root {
+    if( $Is_VMS ) {
+        # On older systems we might exceed the 8-level directory depth limit
+        # imposed by RMS.  We get around this with a rooted logical, but we
+        # can't create logical names with attributes in Perl, so we do it
+        # in a DCL subprocess and put it in the job table so the parent sees 
it.
+        open( MMTMP, '>mmtesttmp.com' ) || 
+          die "Error creating command file; $!";
+        print MMTMP <<'COMMAND';
+$ MM_TEST_ROOT = 
F$PARSE("SYS$DISK:[-]",,,,"NO_CONCEAL")-".][000000"-"]["-"].;"+".]"
+$ DEFINE/JOB/NOLOG/TRANSLATION=CONCEALED MM_TEST_ROOT 'MM_TEST_ROOT'
+COMMAND
+        close MMTMP;
+
+        system '@mmtesttmp.com';
+        1 while unlink 'mmtesttmp.com';
+    }
+}
+
 =back
 
 =head1 AUTHOR

Reply via email to