From a2229d239b26660d3af146abb19daba93846b4da Mon Sep 17 00:00:00 2001 From: Thierry Vignaud Date: Wed, 23 May 2012 18:27:31 +0000 Subject: (_mirrors_raw_install) split it out of mirrors_raw() --- perl-install/mirror.pm | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/perl-install/mirror.pm b/perl-install/mirror.pm index 075f7eb30..2df0fd09a 100644 --- a/perl-install/mirror.pm +++ b/perl-install/mirror.pm @@ -53,6 +53,19 @@ sub register_downloader { $downloader = $func; } +sub _mirrors_raw_install { + my ($list) = @_; + require install::http; + my $f = install::http::getFile($list, "strict-certificate-check" => 1) or die "mirror list not found"; + local $SIG{ALRM} = sub { die "timeout" }; + alarm 60; + log::l("using mirror list $list"); + my @lines; + push @lines, $_ while <$f>; + alarm 0; + @lines; +} + sub mirrors_raw { my ($product_id) = @_; @@ -64,13 +77,7 @@ sub mirrors_raw { log::explanations("trying mirror list from $list"); my @lines; if ($::isInstall) { - require install::http; - my $f = install::http::getFile($list, "strict-certificate-check" => 1) or die "mirror list not found"; - local $SIG{ALRM} = sub { die "timeout" }; - alarm 60; - log::l("using mirror list $list"); - push @lines, $_ while <$f>; - alarm 0; + @lines = _mirrors_raw_install($list); } else { if (ref($downloader)) { @lines = $downloader->($list); -- cgit v1.2.1