diff options
Diffstat (limited to 'Master/tlpkg/tlperl/lib/CPAN.pm')
-rw-r--r-- | Master/tlpkg/tlperl/lib/CPAN.pm | 109 |
1 files changed, 100 insertions, 9 deletions
diff --git a/Master/tlpkg/tlperl/lib/CPAN.pm b/Master/tlpkg/tlperl/lib/CPAN.pm index 0c9b9f5b09f..2d87f47f8b9 100644 --- a/Master/tlpkg/tlperl/lib/CPAN.pm +++ b/Master/tlpkg/tlperl/lib/CPAN.pm @@ -2,7 +2,7 @@ # vim: ts=4 sts=4 sw=4: use strict; package CPAN; -$CPAN::VERSION = '2.22'; +$CPAN::VERSION = '2.27'; $CPAN::VERSION =~ s/_//; # we need to run chdir all over and we would get at wrong libraries @@ -286,7 +286,10 @@ sub shell { } if (my $histfile = $CPAN::Config->{'histfile'}) {{ unless ($term->can("AddHistory")) { - $CPAN::Frontend->mywarn("Terminal does not support AddHistory.\n\nTo fix enter> install Term::ReadLine::Perl\n\n"); + $CPAN::Frontend->mywarn("Terminal does not support AddHistory.\n"); + unless ($CPAN::META->has_inst('Term::ReadLine::Perl')) { + $CPAN::Frontend->mywarn("\nTo fix that, maybe try> install Term::ReadLine::Perl\n\n"); + } last; } $META->readhist($term,$histfile); @@ -1028,7 +1031,10 @@ sub has_usable { $usable = { # - # these subroutines die if they believe the installed version is unusable; + # most of these subroutines warn on the frontend, then + # die if the installed version is unusable for some + # reason; has_usable() then returns false when it caught + # an exception, otherwise returns true and caches that; # 'CPAN::Meta' => [ sub { @@ -1059,6 +1065,23 @@ sub has_usable { }, ], + 'CPAN::Reporter' => [ + sub { + if (defined $CPAN::Reporter::VERSION + && CPAN::Version->vlt($CPAN::Reporter::VERSION, "1.2011") + ) { + delete $INC{"CPAN/Reporter.pm"}; + } + require CPAN::Reporter; + unless (CPAN::Version->vge(CPAN::Reporter->VERSION, "1.2011")) { + for ("Will not use CPAN::Reporter, need version 1.2011\n") { + $CPAN::Frontend->mywarn($_); + die $_; + } + } + }, + ], + LWP => [ # we frequently had "Can't locate object # method "new" via package "LWP::UserAgent" at # (eval 69) line 2006 @@ -1445,11 +1468,12 @@ sub set_perl5lib { $ENV{PERL5LIB} = join $Config::Config{path_sep}, @dirs, @env; } else { my $cnt = keys %{$self->{is_tested}}; - $CPAN::Frontend->optprint('perl5lib', "Prepending blib/arch and blib/lib of ". - "$cnt build dirs to PERL5LIB; ". - "for '$for'\n" + my $newenv = join $Config::Config{path_sep}, @dirs, @env; + $CPAN::Frontend->optprint('perl5lib', sprintf ("Prepending blib/arch and blib/lib of ". + "%d build dirs to PERL5LIB, reaching size %d; ". + "for '%s'\n", $cnt, length($newenv), $for) ); - $ENV{PERL5LIB} = join $Config::Config{path_sep}, @dirs, @env; + $ENV{PERL5LIB} = $newenv; } }} @@ -2121,6 +2145,12 @@ where WORD is any valid config variable or a regular expression. The following keys in the hash reference $CPAN::Config are currently defined: + allow_installing_module_downgrades + allow or disallow installing module downgrades + allow_installing_outdated_dists + allow or disallow installing modules that are + indexed in the cpan index pointing to a distro + with a higher distro-version number applypatch path to external prg auto_commit commit all changes to config variables to disk build_cache size of cache for directories to build modules @@ -2134,7 +2164,8 @@ currently defined: check_sigs if signatures should be verified cleanup_after_install remove build directory immediately after a - successful install + successful install and remember that for the + duration of the session colorize_debug Term::ANSIColor attributes for debugging output colorize_output boolean if Term::ANSIColor should colorize output colorize_print Term::ANSIColor attributes for normal output @@ -2238,6 +2269,10 @@ currently defined: CPAN::Reporter history) unzip location of external program unzip urllist arrayref to nearby CPAN sites (or equivalent locations) + urllist_ping_external + use external ping command when autoselecting mirrors + urllist_ping_verbose + increase verbosity when autoselecting mirrors use_prompt_default set PERL_MM_USE_DEFAULT for configure/make/test/install use_sqlite use CPAN::SQLite for metadata storage (fast and lean) username your username if you CPAN server wants one @@ -2378,11 +2413,48 @@ installed. It is only built and tested, and then kept in the list of tested but uninstalled modules. As such, it is available during the build of the dependent module by integrating the path to the C<blib/arch> and C<blib/lib> directories in the environment variable -PERL5LIB. If C<build_requires_install_policy> is set ti C<yes>, then +PERL5LIB. If C<build_requires_install_policy> is set to C<yes>, then both modules declared as C<requires> and those declared as C<build_requires> are treated alike. By setting to C<ask/yes> or C<ask/no>, CPAN.pm asks the user and sets the default accordingly. +=head2 Configuration of the allow_installing_* parameters + +The C<allow_installing_*> parameters are evaluated during +the C<make> phase. If set to C<yes>, they allow the testing and the installation of +the current distro and otherwise have no effect. If set to C<no>, they +may abort the build (preventing testing and installing), depending on the contents of the +C<blib/> directory. The C<blib/> directory is the directory that holds +all the files that would usually be installed in the C<install> phase. + +C<allow_installing_outdated_dists> compares the C<blib/> directory with the CPAN index. +If it finds something there that belongs, according to the index, to a different +dist, it aborts the current build. + +C<allow_installing_module_downgrades> compares the C<blib/> directory +with already installed modules, actually their version numbers, as +determined by ExtUtils::MakeMaker or equivalent. If a to-be-installed +module would downgrade an already installed module, the current build +is aborted. + +An interesting twist occurs when a distroprefs document demands the +installation of an outdated dist via goto while +C<allow_installing_outdated_dists> forbids it. Without additional +provisions, this would let the C<allow_installing_outdated_dists> +win and the distroprefs lose. So the proper arrangement in such a case +is to write a second distroprefs document for the distro that C<goto> +points to and overrule the C<cpanconfig> there. E.g.: + + --- + match: + distribution: "^MAUKE/Keyword-Simple-0.04.tar.gz" + goto: "MAUKE/Keyword-Simple-0.03.tar.gz" + --- + match: + distribution: "^MAUKE/Keyword-Simple-0.03.tar.gz" + cpanconfig: + allow_installing_outdated_dists: yes + =head2 Configuration for individual distributions (I<Distroprefs>) (B<Note:> This feature has been introduced in CPAN.pm 1.8854) @@ -3922,6 +3994,25 @@ directory) or exit the CPAN shell, respectively. If you never start up the CPAN shell, you probably also have to clean up the build directory yourself. +=item 19) + +How can I switch to sudo instead of local::lib? + +The following 5 environment veriables need to be reset to the previous +values: PATH, PERL5LIB, PERL_LOCAL_LIB_ROOT, PERL_MB_OPT, PERL_MM_OPT; +and these two CPAN.pm config variables must be reconfigured: +make_install_make_command and mbuild_install_build_command. The five +env variables have probably been overwritten in your $HOME/.bashrc or +some equivalent. You either find them there and delete their traces +and logout/login or you override them temporarily, depending on your +exact desire. The two cpanpm config variables can be set with: + + o conf init /install_.*_command/ + +probably followed by + + o conf commit + =back =head1 COMPATIBILITY |