On Fri, Mar 02, 2001 at 05:44:40PM -0600, Craig A. Berry wrote:
> I don't know where the code I'm removing came from but it breaks the test
> because it changes the default directory and makes it impossible to locate 
> libraries, which are located via relative path in the test suite.  They 
> are located via absolute path from an installed perl, which is why running 
> the test individually works.  The END block I've removed also executes a DCL 
> command for all platforms (which some of them might not like ;-).

This looks like its the code for VMS systems which can't support
directory trees deeper than 8 levels.  I guess
perl-current/pod/t/testpods/lib/Pod/Stuff.pm was just too deep when
added to something like /usr/src (or whatever you guys use in
VMS-land).

It doesn't look like this went through p5p, I've attached the message
here:


Date:     Fri, 23 Feb 2001 22:22:57 EST
From: [EMAIL PROTECTED] (Charles Lane)
Message-Id: <[EMAIL PROTECTED]>
Subject:  Re: [PATCH - perl8585] glob-in-eval memory leak fix
In-Reply-To: Your message <[EMAIL PROTECTED]> dated 23-Feb-2001
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]


Jarkko Hietaniemi <[EMAIL PROTECTED]> wrote:
> On Fri, Feb 23, 2001 at 02:28:59PM -0500, Charles Lane wrote:
>>
>> Please back this one out...further study has convinced me that
>> while there may be a memory leak, this probably isn't the
>> correct fix.

> Okay.  As a sign of true repentance :-) please take a look at Schwern's
> recent pod/*.t related patch, there are some VMS issues.

Okay, okay....I grabbed the recently posted patch to pod/find.t
and found several failures (well, test *1* worked okay!)

Test 2 failed because Pod::Find.pm needed a VMS-specific fix. (incl. below)
Test 3 failed because of directory depth limits exceeded
Test 4 failed because of several problems, a including missing
       file, directory depth limits (like 3) and some silly
       typos.

The directory depth limit requires some explanation: while the
disk structure used on VMS is not limited in directory depth; the
i/o system has an 8-level limit.  This can be worked around (to
16 levels) via the use of a "concealed logical name"...think of
it as a pointer into the directory structure.

Sooo...here's a patch to pod/find.t that adds to the BEGIN
section setting up a concealed logical & and END section that
cleans up after.

It looks like the MANIFEST mod that came with the patch had
   t/pod/test_pods/pod/perlfoo.pod
which wasn't included in the patch, and the find.t code made
reference to a "perlfunc.pod" file...probably left over from
edits on an old version, is my guess.

On test 4, we need to "catdir" rather than "catfile" to get the
right syntax for VMS, the comparison needs to be computed for
both VMS and non-VMS systems, and since both the result and the
comparison come out in the same form we can use the same results-
checking logic.

I'm doing a full test-suite run currently, just to make sure
there's no oddball effects, but running the individual tests
by hand makes me confident enough to send this out.

diff -uBb lib/Pod/Find.pm-orig lib/Pod/Find.pm
--- lib/Pod/Find.pm-orig        Fri Feb 23 16:41:52 2001
+++ lib/Pod/Find.pm     Fri Feb 23 16:51:06 2001
@@ -163,6 +163,7 @@
         # on VMS canonpath will vmsify:[the.path], but File::Find::find
         # wants /unixy/paths
         $try = File::Spec->canonpath($try) if ($^O ne 'VMS');
+        $try = VMS::Filespec::unixify($try) if ($^O eq 'VMS');
         my $name;
         if(-f $try) {
             if($name = _check_and_extract_name($try, $opts{-verbose})) {
diff -uBb t/pod/find.t-orig t/pod/find.t
--- t/pod/find.t-orig   Fri Feb 23 16:43:20 2001
+++ t/pod/find.t        Fri Feb 23 22:21:10 2001
@@ -5,10 +5,29 @@
 
 use Test;
 
-BEGIN { plan tests => 4 }
+BEGIN { 
+  plan tests => 4; 
+  use File::Spec;
+  if ($^O eq 'VMS') {
+     $DEFAULT_DIR = $ENV{'DEFAULT'};
+     my $here = $DEFAULT_DIR;
+     my ($dev,$dir) = File::Spec->splitpath($here);
+     $dev =~ s/:$//;
+     $dev = $ENV{$dev} if exists($ENV{$dev});
+     $dev .= ':' if $dev !~ /:/;
+     $here = File::Spec->canonpath($dev.$dir);
+     $here =~ s/\]$/.]/;
+     system "define/nolog/job/trans=conceal temp_perl_base $here";
+     chdir('temp_perl_base:[000000]');
+  }
+}
+
+END {
+    chdir($DEFAULT_DIR) if $^O eq 'VMS';
+    system "deassign/job temp_perl_base";
+}
 
 use Pod::Find qw(pod_find pod_where);
-use File::Spec;
 
 # load successful
 ok(1);
@@ -67,21 +86,14 @@
 }
 
 # Search for a documentation pod rather than a module
-print "### searching for perlfunc.pod\n";
-my $search = File::Spec->catfile('pod', 'test_pods', 'pod');
+print "### searching for perlfoo.pod\n";
+my $search = File::Spec->catdir('pod', 'test_pods', 'pod');
 $result = pod_where({ -dirs => [$search], -verbose => $VERBOSE }, 'perlfoo')
-  || 'undef - perlfunc.pod not found!';
+  || 'undef - perlfoo.pod not found!';
 print "### found $result\n";
 
-if ($^O eq 'VMS') {
-    $result = VMS::Filespec::unixify($result);
-    $result =~ s/^\.\.//;  # needed under `mms test`
-    ok($result,$compare);
-}
-else {
-    $compare = File::Spec->catfile('pod', 'test_pods', 'pod' ,'perlfunc.pod');
-    ok(_canon($result),_canon($compare));
-}
+$compare = File::Spec->catfile('pod', 'test_pods', 'pod' ,'perlfoo.pod');
+ok(_canon($result),_canon($compare));
 
 # make the path as generic as possible
 sub _canon
--
 Drexel University       \V                    --Chuck Lane
======]---------->--------*------------<-------[===========
     (215) 895-1545     _/ \  Particle Physics
FAX: (215) 895-5934     /\ /~~~~~~~~~~~        [EMAIL PROTECTED]







-- 

Michael G. Schwern   <[EMAIL PROTECTED]>    http://www.pobox.com/~schwern/
Any sufficiently encapsulated hack is no longer a hack.

Reply via email to