diff options
author | John Malmberg <wb8tyw@gmail.com> | 2009-01-24 16:28:58 +0000 |
---|---|---|
committer | Nicholas Clark <nick@ccl4.org> | 2009-01-24 16:28:58 +0000 |
commit | 6ef6dcadfcaedc67da16606d65837aaaaf396221 (patch) | |
tree | e7dfb8ef1745ed959d50301f5ccbed029dfecf86 /lib/ExtUtils | |
parent | 5c9818e9e65635805ede01ae50bfadc02253f285 (diff) | |
download | perl-6ef6dcadfcaedc67da16606d65837aaaaf396221.tar.gz |
VMS has a mode where it preserved case, and also has a mode where it
returns filenames in UNIX syntax.
This updates this test to handle these modes.
Diffstat (limited to 'lib/ExtUtils')
-rw-r--r-- | lib/ExtUtils/t/Constant.t | 27 |
1 files changed, 24 insertions, 3 deletions
diff --git a/lib/ExtUtils/t/Constant.t b/lib/ExtUtils/t/Constant.t index 7c997fe21b..02b7528bcb 100644 --- a/lib/ExtUtils/t/Constant.t +++ b/lib/ExtUtils/t/Constant.t @@ -47,8 +47,29 @@ if ($^O eq 'MSWin32' && $make eq 'nmake') { $make .= " -nologo"; } # VMS may be using something other than MMS/MMK my $mms_or_mmk = 0; +my $vms_lc = 0; +my $vms_nodot = 0; if ($^O eq 'VMS') { - $mms_or_mmk = 1 if (($make eq 'MMK') || ($make eq 'MMS')); + $mms_or_mmk = 1 if (($make eq 'MMK') || ($make eq 'MMS')); + $vms_lc = 1; + $vms_nodot = 1; + my $vms_unix_rpt = 0; + my $vms_efs = 0; + my $vms_efs_case = 0; + if (eval 'require VMS::Feature') { + $vms_unix_rpt = VMS::Feature::current("filename_unix_report"); + $vms_efs = VMS::Feature::current("efs_case_preserve"); + $vms_efs_case = VMS::Feature::current("efs_charset"); + } else { + my $unix_rpt = $ENV{'DECC$FILENAME_UNIX_REPORT'} || ''; + my $efs_charset = $ENV{'DECC$EFS_CHARSET'} || ''; + my $efs_case = $ENV{'DECC$EFS_CASE_PRESERVE'} || ''; + $vms_unix_rpt = $unix_rpt =~ /^[ET1]/i; + $vms_efs = $efs_charset =~ /^[ET1]/i; + $vms_efs_case = $efs_case =~ /^[ET1]/i; + } + $vms_lc = 0 if $vms_efs_case; + $vms_nodot = 0 if $vms_unix_rpt; } # Renamed by make clean @@ -111,12 +132,12 @@ package main; sub check_for_bonus_files { my $dir = shift; - my %expect = map {($^O eq 'VMS' ? lc($_) : $_), 1} @_; + my %expect = map {($vms_lc ? lc($_) : $_), 1} @_; my $fail; opendir DIR, $dir or die "opendir '$dir': $!"; while (defined (my $entry = readdir DIR)) { - $entry =~ s/\.$// if $^O eq 'VMS'; # delete trailing dot that indicates no extension + $entry =~ s/\.$// if $vms_nodot; # delete trailing dot that indicates no extension next if $expect{$entry}; print "# Extra file '$entry'\n"; $fail = 1; |