1 # -*- Mode: cperl; coding: utf-8; cperl-indent-level: 4 -*-
2 package CPAN::Mirrored::By;
5 $VERSION = sprintf "%.2f", substr(q$Rev: 450 $,4)/100;
11 sub continent { shift->[0] }
12 sub country { shift->[1] }
13 sub url { shift->[2] }
15 package CPAN::FirstTime;
18 use ExtUtils::MakeMaker ();
20 use File::Basename ();
23 use vars qw($VERSION);
24 $VERSION = sprintf "%.2f", substr(q$Rev: 450 $,4)/100;
28 CPAN::FirstTime - Utility for CPAN::Config file Initialization
32 CPAN::FirstTime::init()
36 The init routine asks a few questions and writes a CPAN/Config.pm or
37 CPAN/MyConfig.pm file (depending on what it is currently using).
42 use vars qw( %prompts );
45 my($configpm, %args) = @_;
47 # extra arg in 'o conf init make' selects only $item =~ /make/
48 my $matcher = $args{args} && @{$args{args}} ? $args{args}[0] : '';
49 CPAN->debug("matcher[$matcher]") if $CPAN::DEBUG;
51 unless ($CPAN::VERSION) {
54 eval {require CPAN::Config;};
66 print $prompts{manual_config};
70 local *_real_prompt = \&ExtUtils::MakeMaker::prompt;
71 if ( $args{autoconfig} ) {
74 $manual_conf = prompt("Are you ready for manual configuration?", "yes");
78 if ($manual_conf =~ /^y/i) {
82 $CPAN::Config->{urllist} ||= [];
85 # prototype should match that of &MakeMaker::prompt
86 *_real_prompt = sub ($;$) {
88 my($ret) = defined $a ? $a : "";
89 $CPAN::Frontend->myprint(sprintf qq{%s [%s]\n\n}, $q, $ret);
90 eval { require Time::HiRes };
92 Time::HiRes::sleep(0.1);
99 $CPAN::Frontend->myprint($prompts{config_intro})
100 if !$matcher or 'config_intro' =~ /$matcher/;
102 my $cpan_home = $CPAN::Config->{cpan_home}
103 || File::Spec->catdir($ENV{HOME}, ".cpan");
106 if (!$matcher or 'config_intro' =~ /$matcher/) {
107 $CPAN::Frontend->myprint(qq{
109 I see you already have a directory
111 Shall we use it as the general CPAN build and cache directory?
116 # no cpan-home, must prompt and get one
117 $CPAN::Frontend->myprint($prompts{cpan_home_where});
120 $default = $cpan_home;
121 while ($ans = prompt("CPAN build and cache directory?",$default)) {
122 unless (File::Spec->file_name_is_absolute($ans)) {
124 my $cwd = Cwd::cwd();
125 my $absans = File::Spec->catdir($cwd,$ans);
126 warn "The path '$ans' is not an absolute path. Please specify an absolute path\n";
130 eval { File::Path::mkpath($ans); }; # dies if it can't
132 warn "Couldn't create directory $ans.\nPlease retry.\n";
135 if (-d $ans && -w _) {
138 warn "Couldn't find directory $ans\n"
139 . "or directory is not writable. Please retry.\n";
142 $CPAN::Config->{cpan_home} = $ans;
144 $CPAN::Frontend->myprint($prompts{keep_source_where});
146 $CPAN::Config->{keep_source_where}
147 = File::Spec->catdir($CPAN::Config->{cpan_home},"sources");
149 $CPAN::Config->{build_dir}
150 = File::Spec->catdir($CPAN::Config->{cpan_home},"build");
153 # Cache size, Index expire
156 $CPAN::Frontend->myprint($prompts{build_cache_intro})
157 if !$matcher or 'build_cache_intro' =~ /$matcher/;
159 # large enough to build large dists like Tk
160 my_dflt_prompt(build_cache => 100, $matcher);
162 # XXX This the time when we refetch the index files (in days)
163 $CPAN::Config->{'index_expire'} = 1;
165 $CPAN::Frontend->myprint($prompts{scan_cache_intro})
166 if !$matcher or 'build_cache_intro' =~ /$matcher/;
168 my_prompt_loop(scan_cache => 'atstart', $matcher, 'atstart|never');
174 if (!$matcher or 'build_cache_intro' =~ /$matcher/) {
176 $CPAN::Frontend->myprint($prompts{cache_metadata});
178 defined($default = $CPAN::Config->{cache_metadata}) or $default = 1;
180 $ans = prompt("Cache metadata (yes/no)?", ($default ? 'yes' : 'no'));
181 } while ($ans !~ /^[yn]/i);
182 $CPAN::Config->{cache_metadata} = ($ans =~ /^y/i ? 1 : 0);
188 $CPAN::Frontend->myprint($prompts{term_is_latin})
189 if !$matcher or 'term_is_latin' =~ /$matcher/;
191 defined($default = $CPAN::Config->{term_is_latin}) or $default = 1;
193 $ans = prompt("Your terminal expects ISO-8859-1 (yes/no)?",
194 ($default ? 'yes' : 'no'));
195 } while ($ans !~ /^[yn]/i);
196 $CPAN::Config->{term_is_latin} = ($ans =~ /^y/i ? 1 : 0);
199 # save history in file 'histfile'
202 $CPAN::Frontend->myprint($prompts{histfile_intro});
204 defined($default = $CPAN::Config->{histfile}) or
205 $default = File::Spec->catfile($CPAN::Config->{cpan_home},"histfile");
206 $ans = prompt("File to save your history?", $default);
207 $CPAN::Config->{histfile} = $ans;
209 if ($CPAN::Config->{histfile}) {
210 defined($default = $CPAN::Config->{histsize}) or $default = 100;
211 $ans = prompt("Number of lines to save?", $default);
212 $CPAN::Config->{histsize} = $ans;
216 # do an ls on the m or the d command
218 $CPAN::Frontend->myprint($prompts{show_upload_date_intro});
220 defined($default = $CPAN::Config->{show_upload_date}) or
222 $ans = prompt("Always try to show upload date with 'd' and 'm' command (yes/no)?",
223 ($default ? 'yes' : 'no'));
224 $CPAN::Config->{show_upload_date} = ($ans =~ /^[y1]/i ? 1 : 0);
226 #my_prompt_loop(show_upload_date => 'n', $matcher,
227 #'follow|ask|ignore');
230 # prerequisites_policy
231 # Do we follow PREREQ_PM?
234 $CPAN::Frontend->myprint($prompts{prerequisites_policy_intro})
235 if !$matcher or 'prerequisites_policy_intro' =~ /$matcher/;
237 my_prompt_loop(prerequisites_policy => 'ask', $matcher,
238 'follow|ask|ignore');
245 $CPAN::Frontend->myprint($prompts{external_progs})
246 if !$matcher or 'external_progs' =~ /$matcher/;
249 local $^W if $^O eq 'MacOS';
250 my(@path) = split /$Config{'path_sep'}/, $ENV{'PATH'};
251 local $^W = $old_warn;
253 for $progname (qw/bzip2 gzip tar unzip make
254 curl lynx wget ncftpget ncftp ftp
257 if ($^O eq 'MacOS') {
258 $CPAN::Config->{$progname} = 'not_here';
261 next if $matcher && $progname !~ /$matcher/;
263 my $progcall = $progname;
264 # we don't need ncftp if we have ncftpget
265 next if $progname eq "ncftp" && $CPAN::Config->{ncftpget} gt " ";
266 my $path = $CPAN::Config->{$progname}
267 || $Config::Config{$progname}
269 if (File::Spec->file_name_is_absolute($path)) {
270 # testing existence is not good enough, some have these exe
273 # warn "Warning: configured $path does not exist\n" unless -e $path;
280 $progcall = $Config::Config{$progname} if $Config::Config{$progname};
283 $path ||= find_exe($progcall,[@path]);
284 $CPAN::Frontend->mywarn("Warning: $progcall not found in PATH\n") unless
285 $path; # not -e $path, because find_exe already checked that
286 $ans = prompt("Where is your $progname program?",$path) || $path;
287 $CPAN::Config->{$progname} = $ans;
289 my $path = $CPAN::Config->{'pager'} ||
290 $ENV{PAGER} || find_exe("less",[@path]) ||
291 find_exe("more",[@path]) || ($^O eq 'MacOS' ? $ENV{EDITOR} : 0 )
293 $ans = prompt("What is your favorite pager program?",$path);
294 $CPAN::Config->{'pager'} = $ans;
295 $path = $CPAN::Config->{'shell'};
296 if (File::Spec->file_name_is_absolute($path)) {
297 warn "Warning: configured $path does not exist\n" unless -e $path;
300 $path ||= $ENV{SHELL};
301 $path ||= $ENV{COMSPEC} if $^O eq "MSWin32";
302 if ($^O eq 'MacOS') {
303 $CPAN::Config->{'shell'} = 'not_here';
305 $path =~ s,\\,/,g if $^O eq 'os2'; # Cosmetic only
306 $ans = prompt("What is your favorite shell?",$path);
307 $CPAN::Config->{'shell'} = $ans;
311 # Arguments to make etc.
314 $CPAN::Frontend->myprint($prompts{prefer_installer_intro})
315 if !$matcher or 'prerequisites_policy_intro' =~ /$matcher/;
317 my_prompt_loop(prefer_installer => 'EUMM', $matcher, 'MB|EUMM');
320 $CPAN::Frontend->myprint($prompts{makepl_arg_intro})
321 if !$matcher or 'makepl_arg_intro' =~ /$matcher/;
323 my_dflt_prompt(makepl_arg => "", $matcher);
325 my_dflt_prompt(make_arg => "", $matcher);
327 my_dflt_prompt(make_install_make_command => $CPAN::Config->{make} || "",
330 my_dflt_prompt(make_install_arg => $CPAN::Config->{make_arg} || "",
333 $CPAN::Frontend->myprint($prompts{mbuildpl_arg_intro})
334 if !$matcher or 'mbuildpl_arg_intro' =~ /$matcher/;
336 my_dflt_prompt(mbuildpl_arg => "", $matcher);
338 my_dflt_prompt(mbuild_arg => "", $matcher);
340 my_dflt_prompt(mbuild_install_build_command => "./Build", $matcher);
342 my_dflt_prompt(mbuild_install_arg => "", $matcher);
348 $CPAN::Frontend->myprint($prompts{inactivity_timeout_intro})
349 if !$matcher or 'inactivity_timeout_intro' =~ /$matcher/;
351 # my_dflt_prompt(inactivity_timeout => 0);
353 $default = $CPAN::Config->{inactivity_timeout} || 0;
354 $CPAN::Config->{inactivity_timeout} =
355 prompt("Timeout for inactivity during {Makefile,Build}.PL?",$default);
359 $CPAN::Frontend->myprint($prompts{proxy_intro})
360 if !$matcher or 'proxy_intro' =~ /$matcher/;
362 for (qw/ftp_proxy http_proxy no_proxy/) {
363 next if $matcher and $_ =~ /$matcher/;
365 $default = $CPAN::Config->{$_} || $ENV{$_};
366 $CPAN::Config->{$_} = prompt("Your $_?",$default);
369 if ($CPAN::Config->{ftp_proxy} ||
370 $CPAN::Config->{http_proxy}) {
372 $default = $CPAN::Config->{proxy_user} || $CPAN::LWP::UserAgent::USER;
374 $CPAN::Frontend->myprint($prompts{proxy_user});
376 if ($CPAN::Config->{proxy_user} = prompt("Your proxy user id?",$default)) {
377 $CPAN::Frontend->myprint($prompts{proxy_pass});
379 if ($CPAN::META->has_inst("Term::ReadKey")) {
380 Term::ReadKey::ReadMode("noecho");
382 $CPAN::Frontend->myprint($prompts{password_warn});
384 $CPAN::Config->{proxy_pass} = prompt_no_strip("Your proxy password?");
385 if ($CPAN::META->has_inst("Term::ReadKey")) {
386 Term::ReadKey::ReadMode("restore");
388 $CPAN::Frontend->myprint("\n\n");
396 conf_sites() unless $fastread;
398 # We don't ask that now, it will be noticed in time, won't it?
399 $CPAN::Config->{'inhibit_startup_message'} = 0;
400 $CPAN::Config->{'getcwd'} = 'cwd';
402 $CPAN::Frontend->myprint("\n\n");
403 CPAN::HandleConfig->commit($configpm);
407 my ($item, $dflt, $m) = @_;
408 my $default = $CPAN::Config->{$item} || $dflt;
411 if (!$m || $item =~ /$m/) {
412 $CPAN::Config->{$item} = prompt($prompts{$item}, $default);
414 $CPAN::Config->{$item} = $default;
419 my ($item, $dflt, $m, $ok) = @_;
420 my $default = $CPAN::Config->{$item} || $dflt;
424 if (!$m || $item =~ /$m/) {
425 do { $ans = prompt($prompts{$item}, $default);
426 } until $ans =~ /$ok/;
427 $CPAN::Config->{$item} = $ans;
429 $CPAN::Config->{$item} = $default;
435 my $m = 'MIRRORED.BY';
436 my $mby = File::Spec->catfile($CPAN::Config->{keep_source_where},$m);
437 File::Path::mkpath(File::Basename::dirname($mby));
438 if (-f $mby && -f $m && -M $m < -M $mby) {
440 File::Copy::copy($m,$mby) or die "Could not update $mby: $!";
444 my $overwrite_local = 0;
445 if ($mby && -f $mby && -M _ <= 60 && -s _ > 0) {
446 my $mtime = localtime((stat _)[9]);
447 my $prompt = qq{Found $mby as of $mtime
449 I\'d use that as a database of CPAN sites. If that is OK for you,
450 please answer 'y', but if you want me to get a new database now,
451 please answer 'n' to the following question.
453 Shall I use the local database in $mby?};
454 my $ans = prompt($prompt,"y");
455 $overwrite_local = 1 unless $ans =~ /^y/i;
458 if ($overwrite_local) {
459 print qq{Trying to overwrite $mby\n};
460 $mby = CPAN::FTP->localize($m,$mby,3);
461 $overwrite_local = 0;
462 } elsif ( ! -f $mby ){
463 print qq{You have no $mby\n I\'m trying to fetch one\n};
464 $mby = CPAN::FTP->localize($m,$mby,3);
465 } elsif (-M $mby > 60 && $loopcount == 0) {
466 print qq{Your $mby is older than 60 days,\n I\'m trying to fetch one\n};
467 $mby = CPAN::FTP->localize($m,$mby,3);
469 } elsif (-s $mby == 0) {
470 print qq{You have an empty $mby,\n I\'m trying to fetch one\n};
471 $mby = CPAN::FTP->localize($m,$mby,3);
476 read_mirrored_by($mby);
483 #warn "in find_exe exe[$exe] path[@$path]";
485 my $abs = File::Spec->catfile($dir,$exe);
486 if (($abs = MM->maybe_command($abs))) {
493 my($items,$prompt,$default,$require_nonempty,$empty_warning)=@_;
501 # display, at most, 15 items at a time
502 my $limit = $#{ $items } - $pos;
503 $limit = 15 if $limit > 15;
505 # show the next $limit items, get the new position
506 $pos = display_some($items, $limit, $pos);
507 $pos = 0 if $pos >= @$items;
509 my $num = prompt($prompt,$default);
511 @nums = split (' ', $num);
512 my $i = scalar @$items;
513 (warn "invalid items entered, try again\n"), next
514 if grep (/\D/ || $_ < 1 || $_ > $i, @nums);
515 if ($require_nonempty) {
516 (warn "$empty_warning\n");
520 # a blank line continues...
529 my ($items, $limit, $pos) = @_;
532 my @displayable = @$items[$pos .. ($pos + $limit)];
533 for my $item (@displayable) {
534 printf "(%d) %s\n", ++$pos, $item;
536 printf("%d more items, hit SPACE RETURN to show them\n",
543 sub read_mirrored_by {
544 my $local = shift or return;
545 my(%all,$url,$expected_size,$default,$ans,$host,
546 $dst,$country,$continent,@location);
547 my $fh = FileHandle->new;
548 $fh->open($local) or die "Couldn't open $local: $!";
551 ($host) = /^([\w\.\-]+)/ unless defined $host;
552 next unless defined $host;
553 next unless /\s+dst_(dst|location)/;
554 /location\s+=\s+\"([^\"]+)/ and @location = (split /\s*,\s*/, $1) and
555 ($continent, $country) = @location[-1,-2];
556 $continent =~ s/\s\(.*//;
557 $continent =~ s/\W+$//; # if Jarkko doesn't know latitude/longitude
558 /dst_dst\s+=\s+\"([^\"]+)/ and $dst = $1;
559 next unless $host && $dst && $continent && $country;
560 $all{$continent}{$country}{$dst} = CPAN::Mirrored::By->new($continent,$country,$dst);
562 $dst=$continent=$country="";
565 $CPAN::Config->{urllist} ||= [];
567 if (@previous_urls = @{$CPAN::Config->{urllist}}) {
568 $CPAN::Config->{urllist} = [];
571 print $prompts{urls_intro};
573 my (@cont, $cont, %cont, @countries, @urls, %seen);
574 my $no_previous_warn =
575 "Sorry! since you don't have any existing picks, you must make a\n" .
576 "geographic selection.";
577 @cont = picklist([sort keys %all],
578 "Select your continent (or several nearby continents)",
584 foreach $cont (@cont) {
585 my @c = sort keys %{$all{$cont}};
586 @cont{@c} = map ($cont, 0..$#c);
587 @c = map ("$_ ($cont)", @c) if @cont > 1;
588 push (@countries, @c);
592 @countries = picklist (\@countries,
593 "Select your country (or several nearby countries)",
597 %seen = map (($_ => 1), @previous_urls);
598 # hmmm, should take list of defaults from CPAN::Config->{'urllist'}...
599 foreach $country (@countries) {
600 (my $bare_country = $country) =~ s/ \(.*\)//;
601 my @u = sort keys %{$all{$cont{$bare_country}}{$bare_country}};
602 @u = grep (! $seen{$_}, @u);
603 @u = map ("$_ ($bare_country)", @u)
608 push (@urls, map ("$_ (previous pick)", @previous_urls));
609 my $prompt = "Select as many URLs as you like (by number),
610 put them on one line, separated by blanks, e.g. '1 4 5'";
611 if (@previous_urls) {
612 $default = join (' ', ((scalar @urls) - (scalar @previous_urls) + 1) ..
614 $prompt .= "\n(or just hit RETURN to keep your previous picks)";
617 @urls = picklist (\@urls, $prompt, $default);
618 foreach (@urls) { s/ \(.*\)//; }
619 push @{$CPAN::Config->{urllist}}, @urls;
623 my %seen = map (($_ => 1), @{$CPAN::Config->{urllist}});
626 my $prompt = "Enter another URL or RETURN to quit:";
628 $prompt = qq{CPAN.pm needs at least one URL where it can fetch CPAN files from.
630 Please enter your CPAN site:};
632 $ans = prompt ($prompt, "");
635 $ans =~ s|/?\z|/|; # has to end with one slash
636 $ans = "file:$ans" unless $ans =~ /:/; # without a scheme is a file:
637 if ($ans =~ /^\w+:\/./) {
638 push @urls, $ans unless $seen{$ans}++;
640 printf(qq{"%s" doesn\'t look like an URL at first sight.
641 I\'ll ignore it for now.
642 You can add it to your %s
643 later if you\'re sure it\'s right.\n},
645 $INC{'CPAN/MyConfig.pm'} || $INC{'CPAN/Config.pm'} || "configuration file",
649 } while $ans || !%seen;
651 push @{$CPAN::Config->{urllist}}, @urls;
652 # xxx delete or comment these out when you're happy that it works
653 print "New set of picks:\n";
654 map { print " $_\n" } @{$CPAN::Config->{urllist}};
659 $_[0] =~ s/^\s+//; # no leading spaces
660 $_[0] =~ s/\s+\z//; # no trailing spaces
665 my $ans = _real_prompt(@_);
673 sub prompt_no_strip ($;$) {
674 return _real_prompt(@_);
684 CPAN is the world-wide archive of perl resources. It consists of about
685 100 sites that all replicate the same contents all around the globe.
686 Many countries have at least one CPAN site already. The resources
687 found on CPAN are easily accessible with the CPAN.pm module. If you
688 want to use CPAN.pm, you have to configure it properly.
690 If you do not want to enter a dialog now, you can answer 'no' to this
691 question and I\'ll try to autoconfigure. (Note: you can revisit this
692 dialog anytime later by typing 'o conf init' at the cpan prompt.)
698 The following questions are intended to help you with the
699 configuration. The CPAN module needs a directory of its own to cache
700 important index files and maybe keep a temporary mirror of CPAN files.
701 This may be a site-wide directory or a personal directory.
705 # cpan_home => qq{ },
707 cpan_home_where => qq{
709 First of all, I\'d like to create this directory. Where?
713 keep_source_where => qq{
715 If you like, I can cache the source files after I build them. Doing
716 so means that, if you ever rebuild that module in the future, the
717 files will be taken from the cache. The tradeoff is that it takes up
718 space. How much space would you like to allocate to this cache? (If
719 you don\'t want me to keep a cache, answer 0.)
723 build_cache_intro => qq{
725 How big should the disk cache be for keeping the build directories
726 with all the intermediate files\?
731 "Cache size for build directory (in MB)?",
734 scan_cache_intro => qq{
736 By default, each time the CPAN module is started, cache scanning is
737 performed to keep the cache size in sync. To prevent this, answer
742 scan_cache => "Perform cache scanning (atstart or never)?",
744 cache_metadata => qq{
746 To considerably speed up the initial CPAN shell startup, it is
747 possible to use Storable to create a cache of metadata. If Storable
748 is not available, the normal index mechanism will be used.
754 The next option deals with the charset (aka character set) your
755 terminal supports. In general, CPAN is English speaking territory, so
756 the charset does not matter much, but some of the aliens out there who
757 upload their software to CPAN bear names that are outside the ASCII
758 range. If your terminal supports UTF-8, you should say no to the next
759 question. If it supports ISO-8859-1 (also known as LATIN1) then you
760 should say yes. If it supports neither, your answer does not matter
761 because you will not be able to read the names of some authors
762 anyway. If you answer no, names will be output in UTF-8.
766 histfile_intro => qq{
768 If you have one of the readline packages (Term::ReadLine::Perl,
769 Term::ReadLine::Gnu, possibly others) installed, the interactive CPAN
770 shell will have history support. The next two questions deal with the
771 filename of the history file and with its size. If you do not want to
772 set this variable, please hit SPACE RETURN to the following question.
776 histfile => qq{File to save your history?},
778 show_upload_date_intro => qq{
780 The 'd' and the 'm' command normally only show you information they
781 have in their in-memory database and thus will never connect to the
782 internet. If you set the 'show_upload_date' variable to true, 'm' and
783 'd' will additionally show you the upload date of the module or
784 distribution. Per default this feature is off because it may require a
785 net connection to get at the upload date.
790 "Always try to show upload date with 'd' and 'm' command (yes/no)?",
792 prerequisites_policy_intro => qq{
794 The CPAN module can detect when a module which you are trying to build
795 depends on prerequisites. If this happens, it can build the
796 prerequisites for you automatically ('follow'), ask you for
797 confirmation ('ask'), or just ignore them ('ignore'). Please set your
798 policy to one of the three values.
802 prerequisites_policy =>
803 "Policy on building prerequisites (follow, ask or ignore)?",
805 external_progs => qq{
807 The CPAN module will need a few external programs to work properly.
808 Please correct me, if I guess the wrong path for a program. Don\'t
809 panic if you do not have some of them, just press ENTER for those. To
810 disable the use of a download program, you can type a space followed
815 prefer_installer_intro => qq{
817 When you have Module::Build installed and a module comes with both a
818 Makefile.PL and a Build.PL, which shall have precedence? The two
819 installer modules we have are the old and well established
820 ExtUtils::MakeMaker (for short: EUMM) understands the Makefile.PL and
821 the next generation installer Module::Build (MB) works with the
827 qq{In case you could choose, which installer would you prefer (EUMM or MB)?},
829 makepl_arg_intro => qq{
831 Every Makefile.PL is run by perl in a separate process. Likewise we
832 run \'make\' and \'make install\' in separate processes. If you have
833 any parameters \(e.g. PREFIX, LIB, UNINST or the like\) you want to
834 pass to the calls, please specify them here.
836 If you don\'t understand this question, just press ENTER.
840 Parameters for the 'perl Makefile.PL' command?
841 Typical frequently used settings:
843 PREFIX=~/perl # non-root users (please see manual for more hints)
847 make_arg => qq{Parameters for the 'make' command?
848 Typical frequently used setting:
850 -j3 # dual processor system
855 make_install_make_command => qq{Do you want to use a different make command for 'make install'?
856 Cautious people will probably prefer:
862 /path1/to/sudo -u admin_account /path2/to/make
864 or some such. Your choice: },
867 make_install_arg => qq{Parameters for the 'make install' command?
868 Typical frequently used setting:
870 UNINST=1 # to always uninstall potentially conflicting files
875 mbuildpl_arg_intro => qq{
877 The next questions deal with Module::Build support.
879 A Build.PL is run by perl in a separate process. Likewise we run
880 './Build' and './Build install' in separate processes. If you have any
881 parameters you want to pass to the calls, please specify them here.
885 mbuildpl_arg => qq{Parameters for the 'perl Build.PL' command?
886 Typical frequently used settings:
888 --install_base /home/xxx # different installation directory
892 mbuild_arg => qq{Parameters for the './Build' command?
895 --extra_linker_flags -L/usr/foo/lib # non-standard library location
900 mbuild_install_build_command => qq{Do you want to use a different command for './Build install'?
901 Sudo users will probably prefer:
907 /path1/to/sudo -u admin_account ./Build
909 or some such. Your choice: },
912 mbuild_install_arg => qq{Parameters for the './Build install' command?
913 Typical frequently used setting:
915 --uninst 1 # uninstall conflicting files
921 inactivity_timeout_intro => qq{
923 Sometimes you may wish to leave the processes run by CPAN alone
924 without caring about them. Because the Makefile.PL sometimes contains
925 question you\'re expected to answer, you can set a timer that will
926 kill a 'perl Makefile.PL' process after the specified time in seconds.
928 If you set this value to 0, these processes will wait forever. This is
929 the default and recommended setting.
933 inactivity_timeout =>
934 qq{Timeout for inactivity during {Makefile,Build}.PL? },
939 If you\'re accessing the net via proxies, you can specify them in the
940 CPAN configuration or via environment variables. The variable in
941 the \$CPAN::Config takes precedence.
947 If your proxy is an authenticating proxy, you can store your username
948 permanently. If you do not want that, just press RETURN. You will then
949 be asked for your username in every future session.
955 Your password for the authenticating proxy can also be stored
956 permanently on disk. If this violates your security policy, just press
957 RETURN. You will then be asked for the password in every future
964 Now we need to know where your favorite CPAN sites are located. Push
965 a few sites onto the array (just in case the first on the array won\'t
966 work). If you are mirroring CPAN to your local workstation, specify a
969 First, pick a nearby continent and country (you can pick several of
970 each, separated by spaces, or none if you just want to keep your
971 existing selections). Then, you will be presented with a list of URLs
972 of CPAN mirrors in the countries you selected, along with previously
973 selected URLs. Select some of those URLs, or just keep the old list.
974 Finally, you will be prompted for any extra URLs -- file:, ftp:, or
975 http: -- that host a CPAN mirror.
981 Warning: Term::ReadKey seems not to be available, your password will
982 be echoed to the terminal!
988 die "Coding error in \@prompts declaration. Odd number of elements, above"
993 if (scalar(keys %prompts) != scalar(@prompts)/2) {
997 for my $item (0..$#prompts) {
999 die "$prompts[$item] is duplicated\n"
1000 if $already{$prompts[$item]}++;