[Module-build-general] Re: MB MacOS fixes
Status: Beta
Brought to you by:
kwilliams
|
From: Ken W. <ke...@ma...> - 2002-12-01 08:46:23
|
On Saturday, November 30, 2002, at 10:23 PM, Ken Williams wrote:
> Looks good. I'm adding it like this, in Platform/MacOS.pm:
>
> --------------------------------------------------
> # ExtUtils::Install has a hard-coded '.' directory in versions less
> # than 1.30. We use a sneaky trick to turn that into ':'.
> #
> # Note that we do it here in a cross-platform way, so this code could
> # actually go in Module::Build::Base. But we put it here to be less
> # intrusive for other platforms.
>
> unless ( eval {ExtUtils::Install->VERSION('1.30')} ) {
> no warnings 'redefine';
> *ExtUtils::Install::find = sub {
> my ($code, @dirs) = @_;
>
> @dirs = map { $_ eq '.' ? File::Spec->curdir : $_ } @dirs;
>
> return File::Find::find($code, @dirs);
> }
> }
> --------------------------------------------------
Correction: because of a bug in UNIVERSAL::VERSION() and a misbehaving
version number in ExtUtils::Install 1.28, the above doesn't work.
Here's the UNIVERSAL bug (using perl 5.6.1):
[kw-009:~] ken% perl -le '$Foo::VERSION = "1.28"; print
Foo->VERSION(1.30)'
Foo version 1.3 required--this is only version 1.28 at -e line 1.
[kw-009:~] ken% perl -le '$Foo::VERSION = "1.28 "; print
Foo->VERSION(1.30)'
49.046050056032
And here's the misbehaving ExtUtils::Install version number (already
fixed in 1.29):
$VERSION = substr q$Revision: 1.28 $, 10;
So here's how I'm putting the patch in:
sub ACTION_install {
my $self = shift;
return $self->SUPER::ACTION_install(@_)
if ExtUtils::Install->VERSION ge '1.30';
no warnings 'redefine';
local *ExtUtils::Install::find = sub {
my ($code, @dirs) = @_;
@dirs = map { $_ eq '.' ? File::Spec->curdir : $_ } @dirs;
return File::Find::find($code, @dirs);
};
return $self->SUPER::ACTION_install(@_);
}
-Ken
|