[Dirvish] configuration directory
Peter Michaux
petermichaux at gmail.com
Wed Apr 2 19:49:23 UTC 2014
When creating a standard CPAN-style module with ExtUtils::MakeMaker or
Module::Build, these two tools automatically handle installation
issues like where to install Perl modules files, man pages, executable
scripts. The person doing the installation can do standard
configuration with INSTALL_BASE or more specific choices. These are
things someone experienced in installing CPAN-style modules knows how
to do and that the cpan command-line tool can handle with options the
user can set.
The one part of the Dirvish v1.2.1 custom install script that doesn't
map easily to standard CPAN-style modules is setting the configuration
directory. Most CPAN-style modules don't need such a concept. If
possible, I think it would be good to avoid adding things that are not
standard in the CPAN module culture.
Module::Starter is a CPAN-style module that does use a configuration
file. Nothing is set at compilation or installation time. It is all
determined at runtime. The code is the following
sub _config_file {
my $self = shift;
my $configdir = $ENV{'MODULE_STARTER_DIR'} || '';
if ( !$configdir && $ENV{'HOME'} ) {
$configdir = dir( $ENV{'HOME'}, '.module-starter' );
}
return file( $configdir, 'config' );
}
Could Dirvish use such a system? It is backwards compatible in that
the configuration directory can still stay as /etc/dirvish if the
environment variable is set.
Other than this configuration directory issue, I have Dirvish moved to
a CPAN-style module.
Peter
More information about the Dirvish
mailing list