Add new globals to perl.exp
[p5sagit/p5-mst-13.2.git] / lib / CPAN / FirstTime.pm
index 3127a5e..8ac180d 100644 (file)
@@ -15,7 +15,7 @@ use ExtUtils::MakeMaker qw(prompt);
 use FileHandle ();
 use File::Path ();
 use vars qw($VERSION);
-$VERSION = substr q$Revision: 1.15 $, 10;
+$VERSION = substr q$Revision: 1.18 $, 10;
 
 =head1 NAME
 
@@ -128,7 +128,7 @@ those.
 
     my(@path) = split($Config{path_sep},$ENV{PATH});
     my $prog;
-    for $prog (qw/gzip tar unzip make lynx ftp/){
+    for $prog (qw/gzip tar unzip make lynx ncftp ftp/){
        my $path = $CPAN::Config->{$prog} || find_exe($prog,[@path]) || $prog;
        $ans = prompt("Where is your $prog program?",$path) || $path;
        $CPAN::Config->{$prog} = $ans;
@@ -178,7 +178,8 @@ without caring about them. As sometimes the Makefile.PL contains
 question you\'re expected to answer, you can set a timer that will
 kill a 'perl Makefile.PL' process after the specified time in seconds.
 
-If you set this value to 0, these processes will wait forever.
+If you set this value to 0, these processes will wait forever. This is
+the default and recommended setting.
 
 };
 
@@ -231,17 +232,18 @@ Testing "$input" ...
        }
     }
 
-    print qq{
+    unless (@{$CPAN::Config->{'wait_list'}||[]}) {
+       print qq{
 
 WAIT support is available as a Plugin. You need the CPAN::WAIT module
 to actually use it.  But we need to know your favorite WAIT server. If
 you don\'t know a WAIT server near you, just press ENTER.
 
 };
-
-    $default = "wait://ls6.informatik.uni-dortmund.de:1404";
-    $ans = prompt("Your favorite WAIT server?\n  ",$default);
-    push @{$CPAN::Config->{'wait_list'}}, $ans;
+       $default = "wait://ls6.informatik.uni-dortmund.de:1404";
+       $ans = prompt("Your favorite WAIT server?\n  ",$default);
+       push @{$CPAN::Config->{'wait_list'}}, $ans;
+    }
 
     print qq{
 
@@ -256,8 +258,9 @@ the \$CPAN::Config takes precedence.
        $CPAN::Config->{$_} = prompt("Your $_?",$default);
     }
 
-    # We don't ask that now, it will be noticed in time....
+    # We don't ask that now, it will be noticed in time, won't it?
     $CPAN::Config->{'inhibit_startup_message'} = 0;
+    $CPAN::Config->{'getcwd'} = 'cwd';
 
     print "\n\n";
     CPAN::Config->commit($configpm);
@@ -324,8 +327,8 @@ file:, ftp: or http: URL, or "q" to finish selecting.
     $ans = $other = "";
     my(%seen);
     
+    my $pipe = -t *STDIN ? "| $CPAN::Config->{'pager'}" : ">/dev/null";
     while () {
-       my $pipe = -t *STDIN ? "| $CPAN::Config->{'pager'}" : ">/dev/null";
        my(@valid,$previous_best);
        my $fh = FileHandle->new;
        $fh->open($pipe);
@@ -351,6 +354,7 @@ file:, ftp: or http: URL, or "q" to finish selecting.
                }
            }
        }
+       $fh->close;
        $previous_best ||= 1;
        $default =
            @{$CPAN::Config->{urllist}} >= $expected_size ? "q" : $previous_best;