Re: [Module::Build] Document install_base_relpaths
Status: Beta
Brought to you by:
kwilliams
|
From: Ken W. <ke...@ma...> - 2006-03-04 17:11:30
|
On Mar 3, 2006, at 3:44 PM, David Wheeler wrote:
> On Feb 17, 2006, at 11:30, David Wheeler wrote:
>
>>> I just discovered install-base_relpaths, and for setting up new
>>> elements to simply be installed relative to whatever the
>>> install_base happens to be, it's very convenient. I'd like to see
>>> it documented in the cookbook. The attached patch adds a note
>>> about it there. Think you might let this be documented?
>>
>> Or perhaps better still, add_build_element could make it the
>> default? That patch would look like this:
>>
>> --- Base.pm 16 Feb 2006 22:06:21 -0800 1.546
>> +++ Base.pm 17 Feb 2006 11:28:54 -0800
>> @@ -449,8 +449,9 @@
>>
>>
>> sub add_build_element {
>> - my $self = shift;
>> - push @{$self->build_elements}, shift;
>> + my ($self, $elem) = @_;
>> + $self->install_base_relpaths->{$elem} ||= [$elem];
>> + push @{$self->build_elements}, $elem;
>>
>> }
>>
>> sub ACTION_config_data {
>
> Any comments on these suggestions? Maybe a different method that
> does both of these actions would be welcomed?
>
> sub add_build_element_with_path {
> my ($self, $elem) = @_;
> $self->add_build_element($elem);
> $self->install_base_relpaths->{$elem} ||= [$elem];
> }
Sorry, I forgot to comment on this after our IRC conversation.
The patch doesn't quite make sense, because the stuff in
build_elements isn't the same kind of stuff that's in
install_base_relpaths. In build_elements we have stuff that's going
to be gathered from the distribution, processed in some way, then put
into the blib/ staging area:
qw(PL support pm xs pod script)
where each has a couple of corresponding methods (e.g. find_pm_files,
process_pm_files) to actually do the work.
But in install_base_relpaths, we have stuff that maps from the blib/
staging area to the default install_base locations on disk:
{
lib => ['lib', 'perl5'],
arch => ['lib', 'perl5', $arch],
bin => ['bin'],
script => ['bin'],
bindoc => ['man', 'man1'],
libdoc => ['man', 'man3'],
binhtml => ['html'],
libhtml => ['html'],
};
So notice that there's no correspondence between the keys of these
two hashes - it wouldn't therefore make any sense in the default case
to put an entry in install_base_relpaths just because there's one in
build_elements.
In general, with custom stuff in a distro, you first specify how it
gets mapped to blib/, then how it gets mapped to installation
directories.
-Ken
|