[Patch libwww 5.47] mods for VMS to test cleanly

Charles Lane (Lane)@duphy4.physics.drexel.edu)
Thu, 6 Apr 2000 17:12:51 EDT


LWP builds cleanly but throws a variety of pain-to-track-down test
errors.  This is a VMS-specific patch, not to bypass the tests for VMS
but to get them to work properly.

There are three basic areas of patching:

        the equivalent of "/dev/nul"  on VMS is "nl:"

        $Config{'perlpath'} isn't defined on VMS, use $^X instead.

        VMS can have multiple "version numbers" of the same filename,
        need to do a "while(unlink(..files..)){}" to make sure we get
        rid of all of them.

Patch follows.

--- t/base/mediatypes.t-orig	Tue Apr  4 08:04:59 2000
+++ t/base/mediatypes.t	Tue Apr  4 08:04:59 2000
@@ -35,7 +35,7 @@
  ["lwp-0.03.tar.Z"      => "application/x-tar", "compress"],
  [$file		        => "text/plain",],
  ["/random/file"        => "application/octet-stream",],
- ["/dev/null"	        => "text/plain",],
+ [($^O eq 'VMS'? "nl:" : "/dev/null") => "text/plain",],
  [$url1	        	=> "image/gif",],
  [$url2	        	=> "application/octet-stream",],
  ["x.ppm.Z.UU"		=> "image/x-portable-pixmap","compress","x-uuencode",],
--- t/local/http.t-orig	Thu Apr  6 17:00:32 2000
+++ t/local/http.t	Thu Apr  6 17:01:32 2000
@@ -16,7 +16,7 @@
     my $d = HTTP::Daemon->new(Timeout => 10);
 
     print "Please to meet you at: <URL:", $d->url, ">\n";
-    open(STDOUT, ">/dev/null");
+    open(STDOUT, $^O eq 'VMS'? ">nl: " : ">/dev/null");
 
     while ($c = $d->accept) {
 	$r = $c->get_request;
@@ -36,7 +36,9 @@
 }
 else {
     use Config;
-    open(DAEMON, "$Config{'perlpath'} local/http.t daemon |") or die "Can't exec daemon: $!";
+    my $perl = $Config{'perlpath'};
+    $perl = $^X if $^O eq 'VMS';
+    open(DAEMON, "$perl local/http.t daemon |") or die "Can't exec daemon: $!";
 }
 
 print "1..18\n";
--- t/robot/rules-dbm.t-orig	Thu Apr  6 16:59:05 2000
+++ t/robot/rules-dbm.t	Thu Apr  6 16:57:48 2000
@@ -115,7 +115,7 @@
 
 untie %cat;			# Otherwise the next line fails on DOSish
 
-unlink "$file", "$file.pag", "$file.dir", "$file.db";
+while (unlink("$file", "$file.pag", "$file.dir", "$file.db")) {}
 
 # Try open a an emty database without specifying a name
 eval { 
--- t/robot/ua.t-orig	Thu Apr  6 16:59:37 2000
+++ t/robot/ua.t	Thu Apr  6 16:59:28 2000
@@ -15,7 +15,7 @@
     my $d = new HTTP::Daemon Timeout => 10;
 
     print "Please to meet you at: <URL:", $d->url, ">\n";
-    open(STDOUT, $^O eq 'MSWin32' ? ">nul" : ">/dev/null");
+    open(STDOUT, $^O eq 'MSWin32' ?  ">nul" : $^O eq 'VMS' ? ">NL:"  : ">/dev/null");
 
     while ($c = $d->accept) {
 	$r = $c->get_request;
@@ -37,7 +37,9 @@
 }
 else {
     use Config;
-    open(DAEMON , "$Config{'perlpath'} robot/ua.t daemon |") or die "Can't exec daemon: $!";
+    my $perl = $Config{'perlpath'};
+    $perl = $^X if $^O eq 'VMS';
+    open(DAEMON , "$perl robot/ua.t daemon |") or die "Can't exec daemon: $!";
 }
 
 print "1..7\n";
--
 Drexel University       \V                     --Chuck Lane
----------------->--------*------------<--------lane@duphy4.hepnet
     (215) 895-1545      / \  Particle Physics  lane@duphy1.bitnet
FAX: (215) 895-5934        /~~~~~~~~~~~         lane@duphy4.physics.drexel.edu