Re: invalid installdirs values
[email protected] ("David E. Wheeler")
| Newsgroups | perl.module.build |
|---|---|
| Message-ID | <[email protected]> |
On Sep 26, 2008, at 15:26, Michael G Schwern wrote:
> Yeah, in this case it's installdirs().
>
> Simplest thing might be to add an optional check/normalizing routine
> to
> add_property().
>
> __PACKAGE__->add_property(installdirs => "site",
> sub {
> return 1 if /^(core|site|vendor)$/;
> return shift->property_error("Perhaps you meant 'core'?") if $_
> eq 'perl';
> return 0;
> }
> );
For future-proofing, I'd be inclined to add support for a hashref of
parameters:
__PACKAGE__->add_property({
name => 'installdirs'
default => 'site',
check => sub {
return 1 if /^(core|site|vendor)$/;
return shift->property_error("Perhaps you meant 'core'?") if
$_ eq 'perl';
return 0;
}
});
This way we can add new keys if we need them in the future. And I
think we might, based on past experience.
I can whip this up if folks are interested.
Best,
David