firsttime.pm
来自「视频监控网络部分的协议ddns,的模块的实现代码,请大家大胆指正.」· PM 代码 · 共 1,637 行 · 第 1/4 页
PM
1,637 行
# -*- Mode: cperl; coding: utf-8; cperl-indent-level: 4 -*-package CPAN::Mirrored::By;use strict;sub new { my($self,@arg) = @_; bless [@arg], $self;}sub continent { shift->[0] }sub country { shift->[1] }sub url { shift->[2] }package CPAN::FirstTime;use strict;use ExtUtils::MakeMaker ();use FileHandle ();use File::Basename ();use File::Path ();use File::Spec ();use vars qw($VERSION $urllist);$VERSION = sprintf "%.6f", substr(q$Rev: 2229 $,4)/1000000 + 5.4;=head1 NAMECPAN::FirstTime - Utility for CPAN::Config file Initialization=head1 SYNOPSISCPAN::FirstTime::init()=head1 DESCRIPTIONThe init routine asks a few questions and writes a CPAN/Config.pm orCPAN/MyConfig.pm file (depending on what it is currently using).In the following all questions and explanations regarding configvariables are collected.=cut# down until the next =back the manpage must be parsed by the program# because the text is used in the init dialogues.=over 2=item auto_commitNormally CPAN.pm keeps config variables in memory and changes need tobe saved in a separate 'o conf commit' command to make them permanentbetween sessions. If you set the 'auto_commit' option to true, changesto a config variable are always automatically committed to disk.Always commit changes to config variables to disk?=item build_cacheCPAN.pm can limit the size of the disk area for keeping the builddirectories with all the intermediate files.Cache size for build directory (in MB)?=item build_dirDirectory where the build process takes place?=item build_dir_reuseUntil version 1.88 CPAN.pm never trusted the contents of the build_dirdirectory between sessions. Since 1.88_58 CPAN.pm has a YAML-basedmechanism that makes it possible to share the contents of thebuild_dir/ directory between different sessions with the same versionof perl. People who prefer to test things several days beforeinstalling will like this feature because it safes a lot of time.If you say yes to the following question, CPAN will try to storeenough information about the build process so that it can pick up infuture sessions at the same state of affairs as it left a previoussession.Store and re-use state information about distributions betweenCPAN.pm sessions?=item build_requires_install_policyWhen a module declares another one as a 'build_requires' prerequisitethis means that the other module is only needed for building ortesting the module but need not be installed permanently. In this caseyou may wish to install that other module nonetheless or just keep itin the 'build_dir' directory to have it available only temporarily.Installing saves time on future installations but makes the perlinstallation bigger.You can choose if you want to always install (yes), never install (no)or be always asked. In the latter case you can set the default answerfor the question to yes (ask/yes) or no (ask/no).Policy on installing 'build_requires' modules (yes, no, ask/yes,ask/no)?=item cache_metadataTo considerably speed up the initial CPAN shell startup, it ispossible to use Storable to create a cache of metadata. If Storable isnot available, the normal index mechanism will be used.Note: this mechanism is not used when use_sqlite is on and SQLLite isrunning.Cache metadata (yes/no)?=item check_sigsCPAN packages can be digitally signed by authors and thus verifiedwith the security provided by strong cryptography. The exact mechanismis defined in the Module::Signature module. While this is generallyconsidered a good thing, it is not always convenient to the end userto install modules that are signed incorrectly or where the key of theauthor is not available or where some prerequisite forModule::Signature has a bug and so on.With the check_sigs parameter you can turn signature checking on andoff. The default is off for now because the whole tool chain for thefunctionality is not yet considered mature by some. The author ofCPAN.pm would recommend setting it to true most of the time andturning it off only if it turns out to be annoying.Note that if you do not have Module::Signature installed, no signaturechecks will be performed at all.Always try to check and verify signatures if a SIGNATURE file is inthe package and Module::Signature is installed (yes/no)?=item colorize_outputWhen you have Term::ANSIColor installed, you can turn on colorizedoutput to have some visual differences between normal CPAN.pm output,warnings, debugging output, and the output of the modules beinginstalled. Set your favorite colors after some experimenting with theTerm::ANSIColor module.Do you want to turn on colored output?=item colorize_printColor for normal output?=item colorize_warnColor for warnings?=item colorize_debugColor for debugging messages?=item commandnumber_in_promptThe prompt of the cpan shell can contain the current command numberfor easier tracking of the session or be a plain string.Do you want the command number in the prompt (yes/no)?=item ftp_passiveShall we always set the FTP_PASSIVE environment variable when dealingwith ftp download (yes/no)?=item getcwdCPAN.pm changes the current working directory often and needs todetermine its own current working directory. Per default it usesCwd::cwd but if this doesn't work on your system for some reason,alternatives can be configured according to the following table: cwd Cwd::cwd getcwd Cwd::getcwd fastcwd Cwd::fastcwd backtickcwd external command cwdPreferred method for determining the current working directory?=item histfileIf you have one of the readline packages (Term::ReadLine::Perl,Term::ReadLine::Gnu, possibly others) installed, the interactive CPANshell will have history support. The next two questions deal with thefilename of the history file and with its size. If you do not want toset this variable, please hit SPACE RETURN to the following question.File to save your history?=item histsizeNumber of lines to save?=item inactivity_timeoutSometimes you may wish to leave the processes run by CPAN alonewithout caring about them. Because the Makefile.PL or the Build.PLsometimes contains question you're expected to answer, you can set atimer that will kill a 'perl Makefile.PL' process after the specifiedtime in seconds.If you set this value to 0, these processes will wait forever. This isthe default and recommended setting.Timeout for inactivity during {Makefile,Build}.PL?=item index_expireThe CPAN indexes are usually rebuilt once or twice per hour, but thetypical CPAN mirror mirrors only once or twice per day. Depending onthe quality of your mirror and your desire to be on the bleeding edge,you may want to set the following value to more or less than one day(which is the default). It determines after how many days CPAN.pmdownloads new indexes.Let the index expire after how many days?=item inhibit_startup_messageWhen the CPAN shell is started it normally displays a greeting messagethat contains the running version and the status of readline support.Do you want to turn this message off?=item keep_source_whereUnless you are accessing the CPAN on your filesystem via a file: URL,CPAN.pm needs to keep the source files it downloads somewhere. Pleasesupply a directory where the downloaded files are to be kept.Download target directory?=item load_module_verbosityWhen CPAN.pm loads a module it needs for some optional feature, itusually reports about module name and version. Choose 'v' to get thismessage, 'none' to suppress it.Verbosity level for loading modules (none or v)?=item makepl_argEvery Makefile.PL is run by perl in a separate process. Likewise werun 'make' and 'make install' in separate processes. If you haveany parameters (e.g. PREFIX, LIB, UNINST or the like) you want topass to the calls, please specify them here.If you don't understand this question, just press ENTER.Typical frequently used settings: PREFIX=~/perl # non-root users (please see manual for more hints)Parameters for the 'perl Makefile.PL' command?=item make_argParameters for the 'make' command? Typical frequently used setting: -j3 # dual processor system (on GNU make)Your choice:=item make_install_argParameters for the 'make install' command?Typical frequently used setting: UNINST=1 # to always uninstall potentially conflicting filesYour choice:=item make_install_make_commandDo you want to use a different make command for 'make install'?Cautious people will probably prefer: su root -c make or sudo make or /path1/to/sudo -u admin_account /path2/to/makeor some such. Your choice:=item mbuildpl_argA Build.PL is run by perl in a separate process. Likewise we run'./Build' and './Build install' in separate processes. If you have anyparameters you want to pass to the calls, please specify them here.Typical frequently used settings: --install_base /home/xxx # different installation directoryParameters for the 'perl Build.PL' command?=item mbuild_argParameters for the './Build' command? Setting might be: --extra_linker_flags -L/usr/foo/lib # non-standard library locationYour choice:=item mbuild_install_argParameters for the './Build install' command? Typical frequently usedsetting: --uninst 1 # uninstall conflicting filesYour choice:=item mbuild_install_build_commandDo you want to use a different command for './Build install'? Sudousers will probably prefer: su root -c ./Build or sudo ./Build or /path1/to/sudo -u admin_account ./Buildor some such. Your choice:=item pagerWhat is your favorite pager program?=item prefer_installerWhen you have Module::Build installed and a module comes with both aMakefile.PL and a Build.PL, which shall have precedence?The main two standard installer modules are the old and wellestablished ExtUtils::MakeMaker (for short: EUMM) which uses theMakefile.PL. And the next generation installer Module::Build (MB)which works with the Build.PL (and often comes with a Makefile.PLtoo). If a module comes only with one of the two we will use that onebut if both are supplied then a decision must be made between EUMM andMB. See also http://rt.cpan.org/Ticket/Display.html?id=29235 for adiscussion about the right default.Or, as a third option you can choose RAND which will make a randomdecision (something regular CPAN testers will enjoy).In case you can choose between running a Makefile.PL or a Build.PL,which installer would you prefer (EUMM or MB or RAND)?=item prefs_dirCPAN.pm can store customized build environments based on regularexpressions for distribution names. These are YAML files where thedefault options for CPAN.pm and the environment can be overridden anddialog sequences can be stored that can later be executed by anExpect.pm object. The CPAN.pm distribution comes with some prefab YAMLfiles that cover sample distributions that can be used as blueprintsto store one own prefs. Please check out the distroprefs/ directory ofthe CPAN.pm distribution to get a quick start into the prefs system.Directory where to store default options/environment/dialogs forbuilding modules that need some customization?=item prerequisites_policyThe CPAN module can detect when a module which you are trying to builddepends on prerequisites. If this happens, it can build theprerequisites for you automatically ('follow'), ask you forconfirmation ('ask'), or just ignore them ('ignore'). Please set yourpolicy to one of the three values.Policy on building prerequisites (follow, ask or ignore)?=item randomize_urllistCPAN.pm can introduce some randomness when using hosts for downloadthat are configured in the urllist parameter. Enter a numeric valuebetween 0 and 1 to indicate how often you want to let CPAN.pm try arandom host from the urllist. A value of one specifies to always use arandom host as the first try. A value of zero means no randomness atall. Anything in between specifies how often, on average, a randomhost should be tried first.Randomize parameter=item scan_cacheBy default, each time the CPAN module is started, cache scanning isperformed to keep the cache size in sync. To prevent this, answer'never'.Perform cache scanning (atstart or never)?=item shellWhat is your favorite shell?=item show_unparsable_versionsDuring the 'r' command CPAN.pm finds modules without version number.When the command finishes, it prints a report about this. If youwant this report to be very verbose, say yes to the followingvariable.Show all individual modules that have no $VERSION?
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?