Craig A. Berry wrote:
At 12:27 AM -0500 9/14/07, John E. Malmberg wrote:

Hello Ken,

Here is another step in getting Module::Build going on VMS.


This is generally a step in the right direction in principle, but
causes the following failure on OS X:

lib/Module/Build/t/install....................................#   Failed test 
at ../lib/Module/Build/t/install.t line 68.
#          got: 'Can't open file 
/Users/craig/perl/t/install_test/usr/local/lib/perl5/site_perl/5.10.0/darwin-2level/auto/Simple/.packlist/:
 No such file or directory at /Users/craig/perl/t/../lib/ExtUtils/Install.pm 
line 691
# '
#     expected: ''
FAILED at test 2

      # Need to remove volume from $map{$_} using splitpath, or else
      # we'll create something crazy like C:\Foo\Bar\E:\Baz\Quux
      # VMS will always have the file separate than the path.
      my ($volume, $path, $file) = File::Spec->splitpath( $map{$_}, 1 );

On UNIX systems, the above is treating the file the same as a path, so the $file component is blank on those systems.

      # catdir needs a list of directories, or it will create something
      # crazy like volume:[Foo.Bar.volume.Baz.Quux]
      my @dirs = File::Spec->splitdir($path);

      # First merge the directories
      $path = File::Spec->catdir($destdir, @dirs);

      # Then put the file back on if there is one.
      $map{$_} = File::Spec->catfile($path, $file);

The above probably needs to only be done if ($file ne '') as a second part. This second part is probably all that is needed to make it work, but the above line.

Apparently catfile works fine on VMS for an empty file specification, but on UNIX, it appends a trailing slash.

So it needs a bit more work (though it addresses something that's
definitely not correct as-is).


Traditional VMS returns filenames and pathnames in lower case, so
the  key $expect to $pods->{$expect} needs to be converted to lowercase.

TODO:
However this will need to be fixed for VMS ODS-5 support as that
will  return the filename in the exact case it was created in. Currently
>> there is no API to let a module know that VMS is in this mode.


IMO all tests of the type "Is this filename the one I'm expecting?"
should be case blind on all platforms.  The default filename lookup
behavior is case blind on the default filesystem on every non-UNIX
platform Perl supports, as well as on OS X with HFS+, so unless you
are doing something intentionally non-portable, I see no reason for
these tests to be case sensitive.  There are of course lots of ways
to do it, but using C<like> instead of C<is> makes sense to me:

% perl -e 'use Test::More qw(no_plan); like (q{Foo.Dat}, qr{^(?i:foo.dat)$}, 
q{File matches});'
ok 1 - File matches
1..1

Yes, that would be better.

-John
[EMAIL PROTECTED]
Personal Opinion Only


Reply via email to