From: John E. Malmberg Date: Mon, 12 Nov 2007 23:47:20 +0000 (-0600) Subject: Re: [PATCH@32279] Upgrade File::Fetch to 0.13_04 - fixed for VMS. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=ae592ab14c238bce9163b06d55dc42dce2bb16c1;p=p5sagit%2Fp5-mst-13.2.git Re: [PATCH@32279] Upgrade File::Fetch to 0.13_04 - fixed for VMS. From: "John E. Malmberg" Message-id: <47393A68.4070003@qsl.net> CPANPLUS working again on VMS. p4raw-id: //depot/perl@32306 --- diff --git a/lib/CPANPLUS/Internals/Fetch.pm b/lib/CPANPLUS/Internals/Fetch.pm index 54d6015..fdc140e 100644 --- a/lib/CPANPLUS/Internals/Fetch.pm +++ b/lib/CPANPLUS/Internals/Fetch.pm @@ -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 diff --git a/lib/CPANPLUS/t/05_CPANPLUS-Internals-Fetch.t b/lib/CPANPLUS/t/05_CPANPLUS-Internals-Fetch.t index 1489b25..bf9f3af 100644 --- a/lib/CPANPLUS/t/05_CPANPLUS-Internals-Fetch.t +++ b/lib/CPANPLUS/t/05_CPANPLUS-Internals-Fetch.t @@ -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 );