summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIlya Zakharevich <ilya@math.berkeley.edu>1998-07-02 20:59:35 -0400
committerGurusamy Sarathy <gsar@cpan.org>1998-07-04 05:31:04 +0000
commit13bc20ff1c1c1ed66d854591abb2409e14aff8a1 (patch)
tree6453328bfe6d5604d95cb4dc93ef013f948534e2
parent771c48746478d09364a137ddcf848a480cc787fe (diff)
downloadperl-13bc20ff1c1c1ed66d854591abb2409e14aff8a1.tar.gz
fix CPAN.pm problem, OS2 tweaks
Message-Id: <199807030459.AAA00097@monk.mps.ohio-state.edu> Subject: [PATCH 5.004_68] PAtch to CPAN first-time p4raw-id: //depot/perl@1301
-rw-r--r--lib/CPAN/FirstTime.pm17
-rw-r--r--lib/ExtUtils/MM_OS2.pm1
-rw-r--r--lib/ExtUtils/MakeMaker.pm8
3 files changed, 19 insertions, 7 deletions
diff --git a/lib/CPAN/FirstTime.pm b/lib/CPAN/FirstTime.pm
index 3fa21c6727..8d7a118a9d 100644
--- a/lib/CPAN/FirstTime.pm
+++ b/lib/CPAN/FirstTime.pm
@@ -41,6 +41,7 @@ sub init {
$CPAN::Config ||= {};
local($/) = "\n";
local($\) = "";
+ local($|) = 1;
my($ans,$default,$local,$cont,$url,$expected_size);
@@ -152,6 +153,7 @@ those.
$path = "";
}
$path ||= $ENV{SHELL};
+ $path =~ s,\\,/,g if $^O eq 'os2'; # Cosmetic only
$ans = prompt("What is your favorite shell?",$path);
$CPAN::Config->{'shell'} = $ans;
@@ -210,7 +212,7 @@ the default and recommended setting.
if (@{$CPAN::Config->{urllist}||[]}) {
print qq{
I found a list of URLs in CPAN::Config and will use this.
-You can change it later with the 'o conf urllist' command.
+You can change it later from CPAN shell with the 'o conf urllist' command.
}
} elsif (
@@ -221,11 +223,18 @@ You can change it later with the 'o conf urllist' command.
read_mirrored_by($local);
} else {
$CPAN::Config->{urllist} ||= [];
+ my $val = 'http://this.field.should.be.inserted/';
+ my $cnt = 0;
while (! @{$CPAN::Config->{urllist}}) {
my($input) = prompt(qq{
-We need to know the URL of your favorite CPAN site.
-Please enter it here:});
+We need to know the URL of your favorite CPAN site. Any one will go,
+you can change it later from CPAN shell with the 'o conf urllist' command.
+A short list is available in 'perlmodlib', as in
+ perldoc perlmodlib
+Please enter it here:}, $val);
$input =~ s/\s//g;
+ die "Did not obtain required field" if $cnt > 10;
+ $cnt++, next if $input eq $val;
next unless $input;
my($wanted) = "MIRRORED.BY";
print qq{
@@ -285,7 +294,7 @@ sub find_exe {
#warn "in find_exe exe[$exe] path[@$path]";
for $dir (@$path) {
my $abs = MM->catfile($dir,$exe);
- if (MM->maybe_command($abs)) {
+ if (($abs = MM->maybe_command($abs))) {
return $abs;
}
}
diff --git a/lib/ExtUtils/MM_OS2.pm b/lib/ExtUtils/MM_OS2.pm
index 5a603caa36..8bddb42c6d 100644
--- a/lib/ExtUtils/MM_OS2.pm
+++ b/lib/ExtUtils/MM_OS2.pm
@@ -43,6 +43,7 @@ sub replace_manpage_separator {
sub maybe_command {
my($self,$file) = @_;
+ $file =~ s,[/\\]+,/,g;
return $file if -x $file && ! -d _;
return "$file.exe" if -x "$file.exe" && ! -d _;
return "$file.cmd" if -x "$file.cmd" && ! -d _;
diff --git a/lib/ExtUtils/MakeMaker.pm b/lib/ExtUtils/MakeMaker.pm
index 375a699c49..e4fe4ed06e 100644
--- a/lib/ExtUtils/MakeMaker.pm
+++ b/lib/ExtUtils/MakeMaker.pm
@@ -180,15 +180,17 @@ sub WriteMakefile {
sub prompt ($;$) {
my($mess,$def)=@_;
- $ISA_TTY = -t STDIN && -t STDOUT ;
+ $ISA_TTY = -t STDIN && (-t STDOUT || !(-f STDOUT || -c STDOUT)) ; # Pipe?
Carp::confess("prompt function called without an argument") unless defined $mess;
my $dispdef = defined $def ? "[$def] " : " ";
$def = defined $def ? $def : "";
my $ans;
+ local $|=1;
+ print "$mess $dispdef";
if ($ISA_TTY) {
- local $|=1;
- print "$mess $dispdef";
chomp($ans = <STDIN>);
+ } else {
+ print "$def\n";
}
return $ans || $def;
}