Subject: | usability issues with install_base and install_path |
Three usability issues which could be trivially fixed and would IMHO go a long way in improving usability of the module as a whole:
Firstly, the POD does not give an example of how to set install_base from the command-line, so you have to intelligently guess. It should explicitly give an example:
--------- 8< --------- 8< --------- 8< --------- 8< --------- 8< ---------
On the command line, that would look like this:
perl Build.PL --install_base /home/ken
--------- 8< --------- 8< --------- 8< --------- 8< --------- 8< ---------
This is particularly important because another intelligent guess might be
perl Build.PL --install_base=/home/ken
with which the option is silently ignored. It would be much better if it told the user they got it wrong!
Thirdly, --install_path settings do not override --install_base, as seen in lib/Module/Build/Base.pm:
--------- 8< --------- 8< --------- 8< --------- 8< --------- 8< ---------
sub install_destination {
my ($self, $type) = @_;
my $p = $self->{properties};
if ($p->{install_base}) {
return File::Spec->catdir($p->{install_base}, $self->install_base_relative($type));
}
return $p->{install_path}{$type} if exists $p->{install_path}{$type};
return $p->{install_sets}{ $p->{installdirs} }{$type};
}
--------- 8< --------- 8< --------- 8< --------- 8< --------- 8< ---------
It would be better written as
--------- 8< --------- 8< --------- 8< --------- 8< --------- 8< ---------
sub install_destination {
my ($self, $type) = @_;
my $p = $self->{properties};
return $p->{install_path}{$type} if exists $p->{install_path}{$type};
if ($p->{install_base}) {
return File::Spec->catdir($p->{install_base}, $self->install_base_relative($type));
}
return $p->{install_sets}{ $p->{installdirs} }{$type};
}
--------- 8< --------- 8< --------- 8< --------- 8< --------- 8< ---------
Currently, if you want to relocate the entire tree but tweak one path differently, you can't specify --install_base and then use --install_path to override that path, so you have to include --install_path parameters for every single one of 'lib', 'arch', 'bin', 'script', 'bindoc', and 'libdoc'. This is arduous to say the least!
Thanks...