summaryrefslogtreecommitdiffstats
path: root/perl-install/mirror.pm
diff options
context:
space:
mode:
authorThierry Vignaud <tv@mageia.org>2012-05-23 18:27:31 +0000
committerThierry Vignaud <tv@mageia.org>2012-05-23 18:27:31 +0000
commita2229d239b26660d3af146abb19daba93846b4da (patch)
tree60634e7698d77fd781289aca2eae2a39e5588666 /perl-install/mirror.pm
parente6e178ef0973bbe18d18d6b5314f9dacafce3592 (diff)
downloaddrakx-a2229d239b26660d3af146abb19daba93846b4da.tar
drakx-a2229d239b26660d3af146abb19daba93846b4da.tar.gz
drakx-a2229d239b26660d3af146abb19daba93846b4da.tar.bz2
drakx-a2229d239b26660d3af146abb19daba93846b4da.tar.xz
drakx-a2229d239b26660d3af146abb19daba93846b4da.zip
(_mirrors_raw_install) split it out of mirrors_raw()
Diffstat (limited to 'perl-install/mirror.pm')
-rw-r--r--perl-install/mirror.pm21
1 files 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);