package ftp; # $Id$ use Net::FTP; use install_any; use network; use log; my %hosts; 1; sub fromEnv() { # using URLPREFIX to find out information if kickstart ($ENV{LOGIN}, $ENV{PASSWORD}, $ENV{HOST}, $ENV{PREFIX}) = $ENV{URLPREFIX} =~ m| :// (?: ([^:]*) # login (?: :([^@]*))? # password @)? ([^/]*) # host /?(.*) # prefix |x unless $ENV{HOST}; @ENV{qw(HOST PREFIX LOGIN PASSWORD)}; } sub new { my ($host, $prefix, $login, $password) = @_; my @l = do { if ($hosts{"$host$prefix"}) { @{$hosts{"$host$prefix"}}; } else { my %options = (Passive => 1, Timeout => 60, Port => 21); $options{Firewall} = $ENV{PROXY} if $ENV{PROXY}; $options{Port} = $ENV{PROXYPORT} if $ENV{PROXYPORT}; unless ($login) { $login = 'anonymous'; $password = '-drakx@'; } my $ftp = Net::FTP->new(network::resolv($host), %options) or die ''; $ftp->login($login, $password) or die ''; $ftp->binary; $ftp->cwd($prefix); my @l = ($ftp, \ (my $retr = undef)); $hosts{"$host$prefix"} = \@l; @l; }}; wantarray ? @l : $l[0]; } sub getFile { my $f = shift; my ($ftp, $retr) = new(@_ ? @_ : fromEnv); $$retr->close if $$retr; $$retr = $ftp->retr($f) or rewindGetFile(); $$retr ||= $ftp->retr($f); } #-sub closeFiles() { #- #- close any existing connections #- foreach (values %hosts) { #- my $retr = $_->[1] if ref $_; #- $$retr->close if $$retr; #- undef $$retr; #- } #-} sub rewindGetFile() { #- close any existing connection. foreach (values %hosts) { my ($ftp) = @{$_ || []}; $ftp->close() if $ftp; } #- make sure to reconnect to server. %hosts = (); } ='distro/mga7'>distro/mga7 Mageia Installer and base platform for many utilitiesThierry Vignaud [tv]
summaryrefslogtreecommitdiffstats
path: root/perl-install/share/po
diff options
context:
space:
mode:
authorThierry Vignaud <tvignaud@mandriva.org>2003-02-17 09:25:51 +0000
committerThierry Vignaud <tvignaud@mandriva.org>2003-02-17 09:25:51 +0000
commitbedb9e58692e167ef4ac7c30b9e8f9a80720c106 (patch)
tree9afb660a56cc67fc70e95d113d87263a13f14796 /perl-install/share/po
parent22ce15b81b4495166341b52d897dbae9ddbdd119 (diff)
downloaddrakx-bedb9e58692e167ef4ac7c30b9e8f9a80720c106.tar
drakx-bedb9e58692e167ef4ac7c30b9e8f9a80720c106.tar.gz
drakx-bedb9e58692e167ef4ac7c30b9e8f9a80720c106.tar.bz2
drakx-bedb9e58692e167ef4ac7c30b9e8f9a80720c106.tar.xz
drakx-bedb9e58692e167ef4ac7c30b9e8f9a80720c106.zip
simplify translator job by propaging pixel english typo fix
Diffstat (limited to 'perl-install/share/po')