Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

For VMS: fixed prefix handling plus other test fixes

git-svn-id: http://svn.perl.org/modules/Module-Build/trunk@13862 50811bd7-b8ce-0310-adc1-d9db26280581
  • Loading branch information...
commit 8734b47d75aeb494ddcfa4de44fad58639d0862d 1 parent 5e59015
@dagolden dagolden authored
View
2  Changes
@@ -11,6 +11,8 @@ Revision history for Perl extension Module::Build.
- 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
View
21 lib/Module/Build/Platform/VMS.pm
@@ -77,10 +77,29 @@ Prefixify taking into account VMS' filepath syntax.
=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 @@ sub _prefixify {
$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) ) {
View
12 t/compat.t
@@ -218,23 +218,25 @@ ok $mb, "Module::Build->new_from_context";
(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 @@ ok $mb, "Module::Build->new_from_context";
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);
View
14 t/properties/share_dir.t
@@ -179,6 +179,11 @@ ok( -d 'blib/lib/auto/share', "blib/lib/auto/share exists" );
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 @@ is_deeply(
"share_dir files copied to blib"
);
+}
+
#--------------------------------------------------------------------------#
# test installing
#--------------------------------------------------------------------------#
@@ -202,6 +209,11 @@ $share_list = Module::Build->rscan_dir(
"$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 @@ is_deeply(
"share_dir files correctly installed"
);
+}
+
#--------------------------------------------------------------------------#
# test with File::ShareDir
#--------------------------------------------------------------------------#
Please sign in to comment.
Something went wrong with that request. Please try again.