At 12:38 AM -0500 3/27/02, Michael G Schwern wrote:

> I'm going to handle this one a little differently.  I like to
>avoid pre-expanding make constants.  Makes things less flexible.  So
>instead of:
>
>    $(NOECHO) $(PERL) -e "print 'read 
>].File::Spec->catfile($self->{PERL_ARCHLIB},'auto','$(FULLEXT)','.packlist').q[ '" 
>>.MM_tmp
>
>we'll do:
>
>    $(NOECHO) $(PERL) "-MFile::Spec" -e "print 'read 
>'.File::Spec->catfile('$(PERL_ARCHLIB)','auto','$(FULLEXT)','.packlist')'" >.MM_tmp
>
>that should do the right thing and still leave $(PERL_ARCHLIB) &
>$(FULLEXT) in the descrip.mms, available to be altered by the caller
>(for whatever reason).

Aha, so it will do the concatenation at build time after the make
utility has done the macro expansion.  Nice.

> > There is one remaining cluster of test failures which I
>> haven't figured out what to do with yet:
>> t/installed......
>> #     Failed test (t/installed.t at line 62)
>> #          got: '0'
>> #     expected: '1'
>> #     Failed test (t/installed.t at line 171)
>> #          got: '0'
>> #     expected: '1'
>> #     Failed test (t/installed.t at line 172)
>> #                   undef
>> #     doesn't match '(?-xism:foobar[>\]]?$)'
>> # Looks like you failed 3 tests of 42.
>>
>> The basic issue here is that the pieces of the FakeMod module are not
>> guaranteed to have the same case when you retrieve their names from
>> the file system as they had when you created them.
>
>No, that's a completely different problem (and it's been fixed).
>These are something else entirely.
>
>It's these tests.
>
>    # VMS 5.6.1 doesn't seem to have $Config{prefixexp}
>    my $prefix = $Config{prefixexp} || $Config{prefix};
>
>    # ActivePerl 5.6.1/631 has $Config{prefixexp} as 'p:' for some reason
>    $prefix = $Config{prefix} if $prefix eq 'p:' && $^O eq 'MSWin32';
>
>    is( $ei->_is_type( File::Spec->catfile($prefix, 'bar'), 'prog'), 1,
>           "... should find prog file under $prefix" );
>
>If you'll look at ExtUtils::Installed::_is_type you'll see it calls
>_is_prefix.  If you look at _is_prefix you'll see some ugly hackery
>for VMS because ExtUtils::Installed wasn't designed with VMS paths in
>mind.  If you run it in the debugger it should be pretty obvious from
>your end why it's not working.

I wasted more time in there than I care to admit a few weeks ago and
found it very convoluted.  I'll try to have another go tomorrow.

>Show me your $Config{prefix} and $Config{prefixexp}, please.  That
>might shed light on the problem.

$ perl -"MConfig" -e "print qq/$Config{prefix}  $Config{prefixexp}/;"
perl_root  perl_root:

> > +# You can concatenate /foo but not foo:, which defaults in the current directory
>> +$prefix = VMS::Filespec::unixify($prefix) if $^O eq 'VMS';
>> +
> >  is( $ei->_is_type( File::Spec->catfile($prefix, 'bar'), 'prog'), 1,
>>      "... should find prog file under $prefix" );
>
>What's the above for?  I sort of follow the comment, but it should be
>taken care of inside ExtUtils::Installed.

Well, if I do this concatenation

$ perl -"MFile::Spec" -e "print File::Spec->catfile('foo:', 'bar')
foo:[]bar

and pass the result to _is_type, I'm telling it the file is on device
foo and has a name of bar, but it's in a directory having the same
name as whatever my current default is.  So it unfortunately needs a
hack and the one I came up with was:

$ perl -"MFile::Spec" -e "print File::Spec->catfile('/foo', 'bar')
foo:[000000]bar

which gives me the root directory, which is what we want for this
case and it also does the right thing when the directory is specified
explicitly:

$ perl -"MFile::Spec" -e "print 
File::Spec->catfile(VMS::Filespec::unixify('foo:[baz]'), 'bar')
foo:[baz]bar

As far as putting it inside Installed.pm, if the concatenation
happens outside of there, then I think the hack to construct a
useable filename also has to occur outside.

-- 
____________________________________________
Craig A. Berry                  
mailto:[EMAIL PROTECTED]

"Literary critics usually know what they're
talking about. Even if they're wrong."
        -- Perl creator Larry Wall

Reply via email to