summaryrefslogtreecommitdiffstats
path: root/perl-install/ftp.pm
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2001-01-07 00:40:28 +0000
committerPascal Rigaux <pixel@mandriva.com>2001-01-07 00:40:28 +0000
commita1b69cf20a8c8693530da4ebda227b8e010d5b1e (patch)
treeb915e70a5515ea0ab477f06f740b98a7931ffaf3 /perl-install/ftp.pm
parentd938092cc7ea332a57d0407352f3982caaae5678 (diff)
downloaddrakx-a1b69cf20a8c8693530da4ebda227b8e010d5b1e.tar
drakx-a1b69cf20a8c8693530da4ebda227b8e010d5b1e.tar.gz
drakx-a1b69cf20a8c8693530da4ebda227b8e010d5b1e.tar.bz2
drakx-a1b69cf20a8c8693530da4ebda227b8e010d5b1e.tar.xz
drakx-a1b69cf20a8c8693530da4ebda227b8e010d5b1e.zip
for the moment, just release cdrom.img, hd.img and hdreiser.img
others should should come...
Diffstat (limited to 'perl-install/ftp.pm')
-rw-r--r--perl-install/ftp.pm14
1 files changed, 10 insertions, 4 deletions
diff --git a/perl-install/ftp.pm b/perl-install/ftp.pm
index 669ed4fcb..14ef68bf0 100644
--- a/perl-install/ftp.pm
+++ b/perl-install/ftp.pm
@@ -27,9 +27,12 @@ sub fromEnv() {
sub new {
my ($host, $prefix, $login, $password) = @_;
+ log::l("ftp::new");
my @l = do { if ($hosts{"$host$prefix"}) {
+ log::l("ftp::new 1");
@{$hosts{"$host$prefix"}};
} else {
+ log::l("ftp::new 2");
my %options = (Passive => 1, Timeout => 60, Port => 21);
$options{Firewall} = $ENV{PROXY} if $ENV{PROXY};
$options{Port} = $ENV{PROXYPORT} if $ENV{PROXYPORT};
@@ -40,6 +43,7 @@ sub new {
my $ftp;
while (1) {
+ log::l("ftp::new 3");
$ftp = Net::FTP->new(network::resolv($host), %options) or die;
$ftp && $ftp->login($login, $password) and last;
@@ -58,10 +62,12 @@ sub new {
sub getFile {
my ($f, @para) = @_;
- my ($ftp, $retr) = new(@para ? @para : fromEnv);
- $$retr->close if $$retr;
- $$retr = $ftp->retr($f) or do { rewindGetFile(); goto &getFile };
- $$retr ||= $ftp->retr($f);
+ foreach (1..2) {
+ my ($ftp, $retr) = new(@para ? @para : fromEnv);
+ $$retr->close if $$retr;
+ $$retr = $ftp->retr($f) and return $$retr;
+ rewindGetFile();
+ }
}
#-sub closeFiles() {