Author: dagolden
Date: Tue Mar 16 16:50:05 2010
New Revision: 13862
Modified:
Module-Build/trunk/Changes
Module-Build/trunk/lib/Module/Build/Platform/VMS.pm
Module-Build/trunk/t/compat.t
Module-Build/trunk/t/properties/share_dir.t
Log:
For VMS: fixed prefix handling plus other test fixes
Modified: Module-Build/trunk/Changes
==============================================================================
--- Module-Build/trunk/Changes (original)
+++ Module-Build/trunk/Changes Tue Mar 16 16:50:05 2010
@@ -11,6 +11,8 @@
- Sets $ENV{HOME} to a temporary directory during testing [David Golden]
+ - For VMS: fixed prefix handling plus other test fixes [Craig Berry]
+
0.3603 - Mon Jan 18 22:28:59 EST 2010
(Oops, I released the last one before I realized this should have been
Modified: Module-Build/trunk/lib/Module/Build/Platform/VMS.pm
==============================================================================
--- Module-Build/trunk/lib/Module/Build/Platform/VMS.pm (original)
+++ Module-Build/trunk/lib/Module/Build/Platform/VMS.pm Tue Mar 16 16:50:05 2010
@@ -77,10 +77,29 @@
=cut
# Translated from ExtUtils::MM_VMS::prefixify()
+
+sub _catprefix {
+ my($self, $rprefix, $default) = @_;
+
+ my($rvol, $rdirs) = File::Spec->splitpath($rprefix);
+ if( $rvol ) {
+ return File::Spec->catpath($rvol,
+ File::Spec->catdir($rdirs, $default),
+ ''
+ )
+ }
+ else {
+ return File::Spec->catdir($rdirs, $default);
+ }
+}
+
+
sub _prefixify {
my($self, $path, $sprefix, $type) = @_;
my $rprefix = $self->prefix;
+ return '' unless defined $path;
+
$self->log_verbose(" prefixify $path from $sprefix to $rprefix\n");
# Translate $(PERLPREFIX) to a real path.
@@ -90,7 +109,7 @@
$self->log_verbose(" rprefix translated to $rprefix\n".
" sprefix translated to $sprefix\n");
- if( length $path == 0 ) {
+ if( length($path) == 0 ) {
$self->log_verbose(" no path to prefixify.\n")
}
elsif( !File::Spec->file_name_is_absolute($path) ) {
Modified: Module-Build/trunk/t/compat.t
==============================================================================
--- Module-Build/trunk/t/compat.t (original)
+++ Module-Build/trunk/t/compat.t Tue Mar 16 16:50:05 2010
@@ -218,23 +218,25 @@
(my $libdir2 = $libdir) =~ s/libdir/lbiidr/;
my $libarch2 = File::Spec->catdir($libdir2, 'arch');
+ my $check_base = $libdir2;
+ $check_base =~ s/\]\z// if $^O eq 'VMS'; # trim trailing ] for appending
other dirs
SKIP: {
my @cases = (
{
label => "INSTALLDIRS=vendor",
args => [ 'INSTALLDIRS=vendor', "INSTALLVENDORLIB=$libdir2",
"INSTALLVENDORARCH=$libarch2"],
- check => qr/\Q$libdir2\E .* Simple\.pm/ix,
+ check => qr/\Q$check_base\E .* Simple\.pm/ix,
},
{
label => "PREFIX=\$libdir2",
args => [ "PREFIX=$libdir2"],
- check => qr/\Q$libdir2\E .* Simple\.pm/ix,
+ check => qr/\Q$check_base\E .* Simple\.pm/ix,
},
{
label => "PREFIX=\$libdir2 LIB=mylib",
args => [ "PREFIX=$libdir2", "LIB=mylib" ],
- check => qr{\Q$libdir2\E[/\\]mylib[/\\]Simple\.pm}ix,
+ check => qr{\Q$check_base\E[/\\\.]mylib[/\\\]]Simple\.pm}ix,
},
);
@@ -244,10 +246,6 @@
for my $c (@cases) {
my @make_args = @{$c->{args}};
- if ($is_vms_mms) { # VMS MMK/MMS macros use different syntax.
- $make_args[0] = '/macro=("' . join('","',@make_args) . '")';
- pop @make_args while scalar(@make_args) > 1;
- }
($output) = stdout_stderr_of(
sub {
$result = $mb->run_perl_script('Makefile.PL', [], \...@make_args);
Modified: Module-Build/trunk/t/properties/share_dir.t
==============================================================================
--- Module-Build/trunk/t/properties/share_dir.t (original)
+++ Module-Build/trunk/t/properties/share_dir.t Tue Mar 16 16:50:05 2010
@@ -179,6 +179,11 @@
my $share_list = Module::Build->rscan_dir('blib/lib/auto/share', sub {-f});
+SKIP:
+{
+
+skip 'filename case not necessarily preserved', 1 if $^O eq 'VMS';
+
is_deeply(
[ sort @$share_list ], [
'blib/lib/auto/share/dist/Simple-Share/foo.txt',
@@ -187,6 +192,8 @@
"share_dir files copied to blib"
);
+}
+
#--------------------------------------------------------------------------#
# test installing
#--------------------------------------------------------------------------#
@@ -202,6 +209,11 @@
"$temp_install/lib/perl5/auto/share", sub {-f}
);
+SKIP:
+{
+
+skip 'filename case not necessarily preserved', 1 if $^O eq 'VMS';
+
is_deeply(
[ sort @$share_list ], [
"$temp_install/lib/perl5/auto/share/dist/Simple-Share/foo.txt",
@@ -210,6 +222,8 @@
"share_dir files correctly installed"
);
+}
+
#--------------------------------------------------------------------------#
# test with File::ShareDir
#--------------------------------------------------------------------------#