Re: [PATCH@32279] Upgrade File::Fetch to 0.13_04 - fixed for VMS.
John E. Malmberg [Mon, 12 Nov 2007 23:47:20 +0000 (17:47 -0600)]
From: "John E. Malmberg" <wb8tyw@qsl.net>
Message-id: <47393A68.4070003@qsl.net>

CPANPLUS working again on VMS.

p4raw-id: //depot/perl@32306

lib/CPANPLUS/Internals/Fetch.pm
lib/CPANPLUS/t/05_CPANPLUS-Internals-Fetch.t

index 54d6015..fdc140e 100644 (file)
@@ -252,6 +252,8 @@ sub _fetch {
                             ### history regarding win32
                             $vol =~ s/:$/|/ if ON_WIN32; 
     
+                            $vol =~ s/:// if ON_VMS;
+
                             ### XXX i'm not sure what cases this is addressing.
                             ### this comes straight from dmq's file:// patches
                             ### for win32. --kane
index 1489b25..bf9f3af 100644 (file)
@@ -76,14 +76,24 @@ isa_ok( $mod,  'CPANPLUS::Module' );
     ### create a file URI. Make sure to split it by LOCAL rules
     ### and JOIN by unix rules, so we get a proper file uri
     ### otherwise, we might break win32. See bug #18702
-    my $target  = CREATE_FILE_URI->(
-                    File::Spec::Unix->catfile( 
-                        File::Spec::Unix->catdir(
-                            File::Spec->splitdir( cwd() ), 
-                        ), 
-                        $base 
-                    )
-                  );
+
+    my $cwd = cwd();
+    my $in_file;
+
+    if ($^O eq 'VMS') {
+        $in_file = File::Spec->catfile($cwd, $base);
+        ### Force UNIX syntax on VMS
+        $in_file = VMS::Filespec::unixify($in_file);
+    } else {
+        $in_file = File::Spec::Unix->catfile(
+                          File::Spec::Unix->catdir(
+                              File::Spec->spitdir( $cwd ),
+                          ),
+                          $base
+                      )
+    }
+
+    my $target  = CREATE_FILE_URI->($in_file);
                   
     my $fake    = $cb->parse_module( module => $target );