📄 config.pm
字号:
package CPANPLUS::Config;use strict;use warnings;use base 'Object::Accessor';use base 'CPANPLUS::Internals::Utils';use Config;use File::Spec;use Module::Load;use CPANPLUS;use CPANPLUS::Error;use CPANPLUS::Internals::Constants;use File::Basename qw[dirname];use IPC::Cmd qw[can_run];use Locale::Maketext::Simple Class => 'CPANPLUS', Style => 'gettext';use Module::Load::Conditional qw[check_install];=pod=head1 NAMECPANPLUS::Config=head1 DESCRIPTIONThis module contains defaults and heuristics for configuration information for CPANPLUS. To change any of these values, pleasesee the documentation in C<CPANPLUS::Configure>.Below you'll find a list of configuration types and keys, andtheir meaning.=head1 CONFIGURATION=cut### BAH! you can't have POD interleaved with a hash### declaration.. so declare every entry seperatedly :(my $Conf = { '_fetch' => { 'blacklist' => [ 'ftp' ], }, ### _source, _build and _mirror are supposed to be static ### no changes should be needed unless pause/cpan changes '_source' => { 'hosts' => 'MIRRORED.BY', 'auth' => '01mailrc.txt.gz', 'stored' => 'sourcefiles', 'dslip' => '03modlist.data.gz', 'update' => '86400', 'mod' => '02packages.details.txt.gz', 'custom_index' => 'packages.txt', }, '_build' => { 'plugins' => 'plugins', 'moddir' => 'build', 'startdir' => '', 'distdir' => 'dist', 'autobundle' => 'autobundle', 'autobundle_prefix' => 'Snapshot', 'autdir' => 'authors', 'install_log_dir' => 'install-logs', 'custom_sources' => 'custom-sources', 'sanity_check' => 1, }, '_mirror' => { 'base' => 'authors/id/', 'auth' => 'authors/01mailrc.txt.gz', 'dslip' => 'modules/03modlist.data.gz', 'mod' => 'modules/02packages.details.txt.gz' },};=head2 Section 'conf'=over 4=item hostsAn array ref containing hosts entries to be queried for packages.An example entry would like this: { 'scheme' => 'ftp', 'path' => '/pub/CPAN/', 'host' => 'ftp.cpan.org' },=cut ### default host list $Conf->{'conf'}->{'hosts'} = [ { 'scheme' => 'ftp', 'path' => '/pub/CPAN/', 'host' => 'ftp.cpan.org' }, { 'scheme' => 'http', 'path' => '/', 'host' => 'www.cpan.org' }, { 'scheme' => 'ftp', 'path' => '/pub/CPAN/', 'host' => 'ftp.nl.uu.net' }, { 'scheme' => 'ftp', 'path' => '/pub/CPAN/', 'host' => 'cpan.valueclick.com' }, { 'scheme' => 'ftp', 'path' => '/pub/languages/perl/CPAN/', 'host' => 'ftp.funet.fi' } ]; =item allow_build_interactivityBoolean flag to indicate whether 'perl Makefile.PL' and similarare run interactively or not. Defaults to 'true'.=cut $Conf->{'conf'}->{'allow_build_interactivity'} = 1;=item baseThe directory CPANPLUS keeps all it's build and state information in.Defaults to ~/.cpanplus.=cut $Conf->{'conf'}->{'base'} = File::Spec->catdir( __PACKAGE__->_home_dir, DOT_CPANPLUS );=item buildflagsAny flags to be passed to 'perl Build.PL'. See C<perldoc Module::Build>for details. Defaults to an empty string.=cut $Conf->{'conf'}->{'buildflags'} = '';=item cpantestBoolean flag to indicate whether or not to mail test results of moduleinstallations to C<http://testers.cpan.org>. Defaults to 'false'.=cut $Conf->{'conf'}->{'cpantest'} = 0;=item cpantest_mxString holding an explicit mailserver to use when sending out emailsfor C<http://testers.cpan.org>. An empty string will use your systemsettings. Defaults to an empty string.=cut $Conf->{'conf'}->{'cpantest_mx'} = '';=item debugBoolean flag to enable or disable extensive debuggging information.Defaults to 'false'.=cut $Conf->{'conf'}->{'debug'} = 0;=item dist_typeDefault distribution type to use when building packages. See C<cpan2dist>or C<CPANPLUS::Dist> for details. An empty string will not use any package building software. Defaults to an empty string.=cut $Conf->{'conf'}->{'dist_type'} = '';=item emailEmail address to use for anonymous ftp access and as C<from> addresswhen sending emails. Defaults to an C<example.com> address.=cut $Conf->{'conf'}->{'email'} = DEFAULT_EMAIL;=item extractdirString containing the directory where fetched archives should be extracted. An empty string will use a directory under your C<base>directory. Defaults to an empty string.=cut $Conf->{'conf'}->{'extractdir'} = '';=item fetchdirString containing the directory where fetched archives should be stored. An empty string will use a directory under your C<base>directory. Defaults to an empty string.=cut $Conf->{'conf'}->{'fetchdir'} = '';=item flushBoolean indicating whether build failures, cache dirs etc shouldbe flushed after every operation or not. Defaults to 'true'.=cut $Conf->{'conf'}->{'flush'} = 1;=item forceBoolean indicating whether files should be forcefully overwrittenif they exist, modules should be installed when they fail tests,etc. Defaults to 'false'.=cut $Conf->{'conf'}->{'force'} = 0;=item libAn array ref holding directories to be added to C<@INC> when CPANPLUSstarts up. Defaults to an empty array reference.=cut $Conf->{'conf'}->{'lib'} = [];=item makeflagsA string holding flags that will be passed to the C<make> programwhen invoked. Defaults to an empty string.=cut $Conf->{'conf'}->{'makeflags'} = '';=item makemakerflagsA string holding flags that will be passed to C<perl Makefile.PL>when invoked. Defaults to an empty string.=cut $Conf->{'conf'}->{'makemakerflags'} = '';=item md5A boolean indicating whether or not md5 checks should be done whenan archive is fetched. Defaults to 'true' if you have C<Digest::MD5>installed, 'false' otherwise.=cut $Conf->{'conf'}->{'md5'} = ( check_install( module => 'Digest::MD5' ) ? 1 : 0 );=item no_updateA boolean indicating whether or not C<CPANPLUS>' source files should beupdated or not. Defaults to 'false'.=cut $Conf->{'conf'}->{'no_update'} = 0;=item passiveA boolean indicating whether or not to use passive ftp connections.Defaults to 'true'.=cut $Conf->{'conf'}->{'passive'} = 1;=item prefer_binA boolean indicating whether or not to prefer command line programs over perl modules. Defaults to 'false' unless you do not have C<Compress::Zlib> installed (as that would mean we could not extractC<.tar.gz> files)=cut ### if we dont have c::zlib, we'll need to use /bin/tar or we ### can not extract any files. Good time to change the default $Conf->{'conf'}->{'prefer_bin'} = (eval {require Compress::Zlib; 1} ? 0 : 1 );=item prefer_makefileA boolean indicating whether or not prefer a C<Makefile.PL> over a C<Build.PL> file if both are present. Defaults to 'true'.=cut $Conf->{'conf'}->{'prefer_makefile'} = 1;=item prereqsA digit indicating what to do when a package you are installing has aprerequisite. Options are: 0 Do not install 1 Install 2 Ask 3 Ignore (dangerous, install will probably fail!)The default is to ask.=cut $Conf->{'conf'}->{'prereqs'} = PREREQ_ASK;=item shellA string holding the shell class you wish to start up when startingC<CPANPLUS> in interactive mode.Defaults to C<CPANPLUS::Shell::Default>, the default CPANPLUS shell.=cut $Conf->{'conf'}->{'shell'} = 'CPANPLUS::Shell::Default';=item show_startup_tipA boolean indicating whether or not to show start up tips in the interactive shell. Defaults to 'true'.=cut $Conf->{'conf'}->{'show_startup_tip'} = 1;=item signatureA boolean indicating whether or not check signatures if packages aresigned. Defaults to 'true' if you have C<gpg> or C<Crypt::OpenPGP> installed, 'false' otherwise.=cut $Conf->{'conf'}->{'signature'} = do { check_install( module => 'Module::Signature', version => '0.06' ) and ( can_run('gpg') || check_install(module => 'Crypt::OpenPGP') ); } ? 1 : 0;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -