Skip to content

Commit

Permalink
os/2 patches from Ilya Zakharevich
Browse files Browse the repository at this point in the history
  • Loading branch information
Andreas Koenig committed Aug 6, 2009
1 parent bbe1c6b commit 0b3a01e
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 7 deletions.
2 changes: 1 addition & 1 deletion lib/CPAN/FTP.pm
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ sub _add_to_statistics {
));
}
# Win32 cannot rename a file to an existing filename
unlink($sfile) if ($^O eq 'MSWin32');
unlink($sfile) if ($^O eq 'MSWin32' or $^O eq 'os2');
_copy_stat($sfile, "$sfile.$$") if -e $sfile;
rename "$sfile.$$", $sfile
or $CPAN::Frontend->mydie("Could not rename '$sfile.$$' to '$sfile': $!\n");
Expand Down
2 changes: 1 addition & 1 deletion lib/CPAN/FirstTime.pm
Original file line number Diff line number Diff line change
Expand Up @@ -928,7 +928,7 @@ sub init {
if ($^O eq 'MacOS') {
$CPAN::Config->{'shell'} = 'not_here';
} else {
$path =~ s,\\,/,g if $^O eq 'os2'; # Cosmetic only
$path ||= 'sh', $path =~ s,\\,/,g if $^O eq 'os2'; # Cosmetic only
my_dflt_prompt(shell => $path, $matcher);
}
}
Expand Down
9 changes: 4 additions & 5 deletions lib/CPAN/HandleConfig.pm
Original file line number Diff line number Diff line change
Expand Up @@ -529,11 +529,10 @@ sub load {
CPAN->debug("doit[$doit]loading[$loading]miss[@miss]") if $CPAN::DEBUG;
return unless $doit || @miss;
return if $loading;
$loading++;
local $loading = 1;

require CPAN::FirstTime;
my($configpm,$fh,$redo);
$redo ||= "";
my($redo,$configpm,$fh);
if (defined $INC{"CPAN/Config.pm"} && -w $INC{"CPAN/Config.pm"}) {
$configpm = $INC{"CPAN/Config.pm"};
$redo++;
Expand Down Expand Up @@ -569,13 +568,13 @@ sub load {
if ($redo && !$doit) {
$CPAN::Frontend->myprint(<<END);
Sorry, we have to rerun the configuration dialog for CPAN.pm due to
some missing parameters...
some missing parameters... Will write to
<<$configpm>>
END
$args{args} = \@miss;
}
my $initialized = CPAN::FirstTime::init($configpm, %args);
$loading--;
return $initialized;
}

Expand Down
1 change: 1 addition & 0 deletions t/12cpan.t
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ sub _f ($) {
File::Spec->catfile(split /\//, shift);
}
use File::Copy qw(cp);
unlink _f"t/CPAN/MyConfig.pm"; # cp non-overwriting on OS/2
cp _f"t/CPAN/TestConfig.pm", _f"t/CPAN/MyConfig.pm"
or die "Could not cp t/CPAN/TestConfig.pm over t/CPAN/MyConfig.pm: $!";
unshift @INC, "t";
Expand Down
2 changes: 2 additions & 0 deletions t/local_utils.pm
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ sub prepare_dot_cpan {
unlink _f"t/dot-cpan/.lock";
mkpath _d"t/dot-cpan/sources/authors/id/A/AN/ANDK";
mkpath _d"t/dot-cpan/Bundle";
# cp is not-overwriting on OS/2
unlink _f"t/CPAN/MyConfig.pm", _f"t/dot-cpan/sources/MIRRORED.BY";
cp _f"t/CPAN/TestConfig.pm", _f"t/CPAN/MyConfig.pm"
or die "Could not cp t/CPAN/TestConfig.pm over t/CPAN/MyConfig.pm: $!";
cp _f"t/CPAN/TestMirroredBy", _f"t/dot-cpan/sources/MIRRORED.BY"
Expand Down

0 comments on commit 0b3a01e

Please sign in to comment.