summaryrefslogtreecommitdiff
path: root/lib/CPAN
diff options
context:
space:
mode:
authorAndreas J. Koenig <a.koenig@kulturbox.de>1997-08-07 00:00:00 +0000
committerTim Bunce <Tim.Bunce@ig.co.uk>1997-08-07 00:00:00 +1200
commit55e314ee04d21f12e0e5a2d83912b5744a6c9659 (patch)
tree83badfd9e91f8b73985d20d7d3d3a0dd14902541 /lib/CPAN
parent4413da2b5f0875910a892a7d22fa716e5ba3566c (diff)
downloadperl-55e314ee04d21f12e0e5a2d83912b5744a6c9659.tar.gz
m2t2 broke CPAN.pm :-(
Diffstat (limited to 'lib/CPAN')
-rw-r--r--lib/CPAN/FirstTime.pm36
-rw-r--r--lib/CPAN/Nox.pm4
2 files changed, 26 insertions, 14 deletions
diff --git a/lib/CPAN/FirstTime.pm b/lib/CPAN/FirstTime.pm
index 8ac180dc71..3e572d67ae 100644
--- a/lib/CPAN/FirstTime.pm
+++ b/lib/CPAN/FirstTime.pm
@@ -15,7 +15,7 @@ use ExtUtils::MakeMaker qw(prompt);
use FileHandle ();
use File::Path ();
use vars qw($VERSION);
-$VERSION = substr q$Revision: 1.18 $, 10;
+$VERSION = substr q$Revision: 1.20 $, 10;
=head1 NAME
@@ -126,20 +126,33 @@ those.
};
- my(@path) = split($Config{path_sep},$ENV{PATH});
+ my(@path) = split /$Config{'path_sep'}/, $ENV{'PATH'};
my $prog;
for $prog (qw/gzip tar unzip make lynx ncftp ftp/){
- my $path = $CPAN::Config->{$prog} || find_exe($prog,[@path]) || $prog;
+ my $path = $CPAN::Config->{$prog} || "";
+ if (MM->file_name_is_absolute($path)) {
+ warn "Warning: configured $path does not exist\n" unless -e $path;
+ $path = "";
+ } else {
+ $path = '';
+ }
+ $path ||= find_exe($prog,[@path]);
+ warn "Warning: $prog not found in PATH\n" unless -e $path;
$ans = prompt("Where is your $prog program?",$path) || $path;
$CPAN::Config->{$prog} = $ans;
}
my $path = $CPAN::Config->{'pager'} ||
$ENV{PAGER} || find_exe("less",[@path]) ||
find_exe("more",[@path]) || "more";
- $ans = prompt("What is your favorite pager program?",$path) || $path;
+ $ans = prompt("What is your favorite pager program?",$path);
$CPAN::Config->{'pager'} = $ans;
- $path = $CPAN::Config->{'shell'} || $ENV{SHELL} || "";
- $ans = prompt("What is your favorite shell?",$path) || $path;
+ $path = $CPAN::Config->{'shell'};
+ if (MM->file_name_is_absolute($path)) {
+ warn "Warning: configured $path does not exist\n" unless -e $path;
+ $path = "";
+ }
+ $path ||= $ENV{SHELL};
+ $ans = prompt("What is your favorite shell?",$path);
$CPAN::Config->{'shell'} = $ans;
#
@@ -185,7 +198,7 @@ the default and recommended setting.
$default = $CPAN::Config->{inactivity_timeout} || 0;
$CPAN::Config->{inactivity_timeout} =
- prompt("Timout for inacivity during Makefile.PL?",$default);
+ prompt("Timeout for inacivity during Makefile.PL?",$default);
#
@@ -268,12 +281,11 @@ the \$CPAN::Config takes precedence.
sub find_exe {
my($exe,$path) = @_;
- my($dir,$MY);
- $MY = {};
- bless $MY, 'MY';
+ my($dir);
+ #warn "in find_exe exe[$exe] path[@$path]";
for $dir (@$path) {
- my $abs = $MY->catfile($dir,$exe);
- if ($MY->maybe_command($abs)) {
+ my $abs = MM->catfile($dir,$exe);
+ if (MM->maybe_command($abs)) {
return $abs;
}
}
diff --git a/lib/CPAN/Nox.pm b/lib/CPAN/Nox.pm
index dc561977c4..23ad760b87 100644
--- a/lib/CPAN/Nox.pm
+++ b/lib/CPAN/Nox.pm
@@ -2,8 +2,8 @@ BEGIN{$CPAN::Suppress_readline=1 unless defined $CPAN::term;}
use CPAN;
-$CPAN::META->hasMD5(0);
-$CPAN::META->hasLWP(0);
+$CPAN::META->has_inst('MD5','no');
+$CPAN::META->has_inst('LWP','no');
@EXPORT = @CPAN::EXPORT;
*AUTOLOAD = \&CPAN::AUTOLOAD;