From a130ec1291fed0faabfc8051f990f6765f1eabe1 Mon Sep 17 00:00:00 2001 From: Francois Pons Date: Wed, 5 Jan 2000 10:48:46 +0000 Subject: *** empty log message *** --- perl-install/ftp.pm | 11 +++++++++++ perl-install/install_any.pm | 6 ++++++ perl-install/pkgs.pm | 2 ++ 3 files changed, 19 insertions(+) diff --git a/perl-install/ftp.pm b/perl-install/ftp.pm index c1b93fec4..350619c23 100644 --- a/perl-install/ftp.pm +++ b/perl-install/ftp.pm @@ -56,3 +56,14 @@ sub getFile($) { $$retr->close if $$retr; $$retr = $ftp->retr(install_any::relGetFile($f)); } + +sub rewindGetFile() { + #- close any existing connection. + foreach (values %hosts) { + my ($ftp) = @{$_ || []}; + $ftp->close() if $ftp; + } + + #- make sure to reconnect to server. + %hosts = (); +} diff --git a/perl-install/install_any.pm b/perl-install/install_any.pm index 7ccb2e73e..a38316bbd 100644 --- a/perl-install/install_any.pm +++ b/perl-install/install_any.pm @@ -55,6 +55,12 @@ sub getFile($) { } goto &getFile; } +sub rewindGetFile() { + if ($::o->{method} && $::o->{method} eq "ftp") { + require ftp; + ftp::rewindGetFile(); #- make sure to reopen connection. + } +} sub kernelVersion { local $_ = readlink("$::o->{prefix}/boot/vmlinuz") || $::testing && "vmlinuz-2.2.testversion" or die "I couldn't find the kernel package!"; diff --git a/perl-install/pkgs.pm b/perl-install/pkgs.pm index 8cae2a75f..e288471c5 100644 --- a/perl-install/pkgs.pm +++ b/perl-install/pkgs.pm @@ -635,6 +635,8 @@ sub install($$$) { c::rpmtransFree($trans); c::rpmdbClose($db); log::l("rpm database closed"); + + install_any::rewindGetFile(); #- make sure to reopen the connection, usefull for ftp. } sub remove($$) { -- cgit v1.2.1