From f823ee7b832e4b4fa34d76dd945cb35a5c444233 Mon Sep 17 00:00:00 2001 From: Francois Pons Date: Wed, 19 Feb 2003 16:51:31 +0000 Subject: added code to retry finding an update medium if something went wrong. --- perl-install/install_steps_interactive.pm | 44 ++++++++++++++++++------------- 1 file changed, 25 insertions(+), 19 deletions(-) (limited to 'perl-install/install_steps_interactive.pm') diff --git a/perl-install/install_steps_interactive.pm b/perl-install/install_steps_interactive.pm index 7041f0d0d..5fbbe1ebb 100644 --- a/perl-install/install_steps_interactive.pm +++ b/perl-install/install_steps_interactive.pm @@ -747,26 +747,32 @@ Do you want to install the updates ?")), #- bring all interface up for installing crypto packages. install_interactive::upNetwork($o); - require crypto; - eval { - my @mirrors = do { my $_w = $o->wait_message('', - N("Contacting Mandrake Linux web site to get the list of available mirrors...")); - crypto::mirrors() }; - #- if no mirror have been found, use current time zone and propose among available. - $u->{mirror} ||= crypto::bestMirror($o->{timezone}{timezone}); - $u->{mirror} = $o->ask_from_treelistf('', - N("Choose a mirror from which to get the packages"), - '|', - \&crypto::mirror2text, - \@mirrors, - $u->{mirror}); - }; - return if $@ || !$u->{mirror}; + #- update medium available and working. + my $update_medium; + do { + require crypto; + eval { + my @mirrors = do { + my $_w = $o->wait_message('', N("Contacting Mandrake Linux web site to get the list of available mirrors...")); + crypto::mirrors() }; + #- if no mirror have been found, use current time zone and propose among available. + $u->{mirror} ||= crypto::bestMirror($o->{timezone}{timezone}); + $u->{mirror} = $o->ask_from_treelistf('', + N("Choose a mirror from which to get the packages"), + '|', + \&crypto::mirror2text, + \@mirrors, + $u->{mirror}); + }; + return if $@; - my $update_medium = do { - my $_w = $o->wait_message('', N("Contacting the mirror to get the list of available packages...")); - crypto::getPackages($o->{prefix}, $o->{packages}, $u->{mirror}); - }; + eval { + if ($u->{mirror}) { + my $_w = $o->wait_message('', N("Contacting the mirror to get the list of available packages...")); + $update_medium = crypto::getPackages($o->{prefix}, $o->{packages}, $u->{mirror}); + } + }; + } while $@; if ($update_medium) { if ($o->choosePackagesTree($o->{packages}, $update_medium)) { -- cgit v1.2.1