From: Peter Prymmer Date: Fri, 18 Aug 2000 18:18:31 +0000 (-0700) Subject: was Re: [PATCH: 6640] VMS Makefile.SH update (fwd) X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=16be52b8fb809cc375006ad8517483286dc5be74;p=p5sagit%2Fp5-mst-13.2.git was Re: [PATCH: 6640] VMS Makefile.SH update (fwd) Message-ID: p4raw-id: //depot/perl@6712 --- diff --git a/lib/Pod/Find.pm b/lib/Pod/Find.pm index fb0f6b8..516a624 100644 --- a/lib/Pod/Find.pm +++ b/lib/Pod/Find.pm @@ -160,7 +160,9 @@ sub pod_find $try = File::Spec->catfile($pwd,$try); } # simplify path - $try = File::Spec->canonpath($try); + # on VMS canonpath will vmsify:[the.path], but File::Find::find + # wants /unixy/paths + $try = File::Spec->canonpath($try) if ($^O ne 'VMS'); my $name; if(-f $try) { if($name = _check_and_extract_name($try, $opts{-verbose})) { diff --git a/t/pod/find.t b/t/pod/find.t index b33d876..c40c8b4 100644 --- a/t/pod/find.t +++ b/t/pod/find.t @@ -16,11 +16,16 @@ ok(1); require Cwd; my $THISDIR = Cwd::cwd(); my $VERBOSE = 0; - -print "*** searching $THISDIR/lib\n"; -my %pods = pod_find("$THISDIR/lib"); +my $lib_dir = File::Spec->catdir($THISDIR,'lib'); +if ($^O eq 'VMS') { + $lib_dir = VMS::Filespec::unixify(File::Spec->catdir($THISDIR,'-','lib','pod')); + $Qlib_dir = $lib_dir; + $Qlib_dir =~ s#\/#::#g; +} +print "### searching $lib_dir\n"; +my %pods = pod_find("$lib_dir"); my $result = join(',', sort values %pods); -print "*** found $result\n"; +print "### found $result\n"; my $compare = join(',', qw( Pod::Checker Pod::Find @@ -31,28 +36,59 @@ my $compare = join(',', qw( Pod::Select Pod::Usage )); -ok($result,$compare); +if ($^O eq 'VMS') { + $compare = lc($compare); + $result = join(',', sort grep {pod::} values %pods); + $result =~ s/$Qlib_dir/pod::/g; + my $count = 0; + my @result = split(/,/,$result); + my @compare = split(/,/,$compare); + foreach(@compare) { + $count += grep {/$_/} @result; + } + ok($count/($#result+1)-1,$#compare); +} +else { + ok($result,$compare); +} # File::Find is located in this place since eons # and on all platforms, hopefully -print "*** searching for File::Find\n"; +print "### searching for File::Find\n"; $result = pod_where({ -inc => 1, -verbose => $VERBOSE }, 'File::Find') || 'undef - pod not found!'; -print "*** found $result\n"; +print "### found $result\n"; require Config; -$compare = File::Spec->catfile($Config::Config{privlib},"File","Find.pm"); -ok(_canon($result),_canon($compare)); +if ($^O eq 'VMS') { # privlib is perl_root:[lib] OK but not under mms + $compare = "lib.File]Find.pm"; + $result =~ s/perl_root:\[\-?\.?//i; + $result =~ s/\[\-?\.?//i; # needed under `mms test` + ok($result,$compare); +} +else { + $compare = File::Spec->catfile($Config::Config{privlib},"File","Find.pm"); + ok(_canon($result),_canon($compare)); +} # Search for a documentation pod rather than a module -print "*** searching for perlfunc.pod\n"; +print "### searching for perlfunc.pod\n"; $result = pod_where({ -inc => 1, -verbose => $VERBOSE }, 'perlfunc') || 'undef - perlfunc.pod not found!'; -print "*** found $result\n"; +print "### found $result\n"; -$compare = File::Spec->catfile($Config::Config{privlib},"perlfunc.pod"); -ok(_canon($result),_canon($compare)); +if ($^O eq 'VMS') { # privlib is perl_root:[lib] unfortunately + $compare = "/lib/pod/perlfunc.pod"; + $result = VMS::Filespec::unixify($result); + $result =~ s/perl_root\///i; + $result =~ s/^\.\.//; # needed under `mms test` + ok($result,$compare); +} +else { + $compare = File::Spec->catfile($Config::Config{privlib},"perlfunc.pod"); + ok(_canon($result),_canon($compare)); +} # make the path as generic as possible sub _canon