On Fri, Nov 4, 2011 at 8:29 PM, Michael G Schwern <schw...@pobox.com> wrote:
> On 2011.11.1 7:29 PM, Craig A. Berry wrote:
>> Depends on the definition of now.   And where.  In blead, 6.63_01 plus
>> my changes passed all tests.  Trying to build 6.63_02 independently
>> just now I get:
>>
>> $ perl Makefile.PL
>> Could not open 'bundled/cpan-meta-yaml.dir/cpan/meta/yaml.dir.pm': no
>> such file or directory at lib/ExtUtils/MM_Unix.pm line 2636.
>> %RMS-F-SYN, file specification syntax error
>>
>> Something is fileifying directory specs and still expecting to treat
>> them as directories.  But the  bundled/ stuff shouldn't matter for
>> blead I don't think, so it might be best to get 6.63_02 into blead
>> assuming Win32 is happy with it.
>
> That's inside parse_version() which is called inside should_use_dist() inside
> my/bundles.pm and I'm a dirty slacker.
>
>    my $inc_version       = MM->parse_version( "$bundle_dir/$dist/$pm_file" );
>
> that should be:
>
>    my $inc_version       = MM->parse_version(
>        File::Spec->catfile($bundle_dir, $dist, $pm_file)
>    );
>
> I pushed a fix to master.  Give it a try please?

That doesn't seem to have done any harm, but nor did it do any good.
Generally, Unix syntax is fine unless you're combining with another
path chunk that is already in native syntax or the path is going to be
seen by an external program (such as the native make equivalents).

I have pushed the following to master, which gets bundles working and
allows us to build and pass all tests.

% git show c6a1f63b04c3a3a6754bb37516f80235929fffa3
commit c6a1f63b04c3a3a6754bb37516f80235929fffa3
Author: Craig A. Berry <craigbe...@mac.com>
Date:   Sat Nov 5 14:36:25 2011 -0500

    Portability for my::bundles.

    On VMS readdir() by default returns directory names with the .DIR
    extension, which needs to be trimmed off if the directory name is
    going to be glued together with other pieces to make a path.

    Also on VMS, filename case is not preserved by default, so we need
    to do a case-blind lookup of Scalar-List-Utils to trigger its
    special handling.

diff --git a/my/bundles.pm b/my/bundles.pm
index 9bc8d83..dee6753 100644
--- a/my/bundles.pm
+++ b/my/bundles.pm
@@ -34,7 +34,7 @@ inc/ as a flattened module directory that MakeMaker
can install.
 my $bundle_dir = "bundled";

 my %special_dist = (
-    "Scalar-List-Utils" => sub {
+    "scalar-list-utils" => sub {
         # Special case for Scalar::Util, never override the XS version with a
         # pure Perl version.  Just check that it's there.
         my $installed = find_installed("Scalar/Util.pm");
@@ -50,6 +50,9 @@ my %special_dist = (
 sub add_bundles_to_inc {
     opendir my $dh, $bundle_dir or die "Can't open bundles directory: $!";
     my @bundles = grep { -d $_ } map { "$bundle_dir/$_" } grep
!/^\./, readdir $dh;
+    if ($^O eq 'VMS') {
+        for my $bundle (@bundles) { $bundle =~ s/\.DIR$//i; }
+    }

     require lib;
     lib->import(@bundles);
@@ -69,7 +72,8 @@ sub copy_bundles {

     opendir my $bundle_dh, $src or die $!;
     for my $dist (grep !/^\./, grep { -d File::Spec->catdir($src, $_)
} readdir $bundle_dh) {
-        my $should_use = $special_dist{$dist} || \&should_use_dist;
+        $dist =~ s/.DIR$//i if $^O eq 'VMS';
+        my $should_use = $special_dist{lc($dist)} || \&should_use_dist;

         next unless $should_use->($dist);

Reply via email to