diff options
author | Pascal Rigaux <pixel@mandriva.com> | 2004-03-01 10:48:24 +0000 |
---|---|---|
committer | Pascal Rigaux <pixel@mandriva.com> | 2004-03-01 10:48:24 +0000 |
commit | 1ac2349ae9e3dbb5c0a7f8a01cacf29428bcd7fe (patch) | |
tree | 725603880fb78ad181d9a2a02c21f5cacb7ca0e4 /perl-install | |
parent | 47d47ee4572a6de788858c6fd05d5391b048173d (diff) | |
download | drakx-1ac2349ae9e3dbb5c0a7f8a01cacf29428bcd7fe.tar drakx-1ac2349ae9e3dbb5c0a7f8a01cacf29428bcd7fe.tar.gz drakx-1ac2349ae9e3dbb5c0a7f8a01cacf29428bcd7fe.tar.bz2 drakx-1ac2349ae9e3dbb5c0a7f8a01cacf29428bcd7fe.tar.xz drakx-1ac2349ae9e3dbb5c0a7f8a01cacf29428bcd7fe.zip |
do not use $o in crypto.pm, pass {distro_type} to mirrors() and bestMirror() instead
Diffstat (limited to 'perl-install')
-rw-r--r-- | perl-install/crypto.pm | 16 | ||||
-rw-r--r-- | perl-install/install_steps_interactive.pm | 5 |
2 files changed, 12 insertions, 9 deletions
diff --git a/perl-install/crypto.pm b/perl-install/crypto.pm index a8fa6f9ec..d5326737b 100644 --- a/perl-install/crypto.pm +++ b/perl-install/crypto.pm @@ -3,7 +3,7 @@ package crypto; # $Id$ use diagnostics; use strict; -use vars qw($o %url2land %land2tzs %static_mirrors %mirrors); +use vars qw(%url2land %land2tzs %static_mirrors %mirrors); use MDK::Common::System; use common; @@ -45,7 +45,9 @@ use ftp; %mirrors = (); sub mirror2text { $mirrors{$_[0]} && $mirrors{$_[0]}[0] . '|' . $_[0] } -sub mirrors() { +sub mirrors { + my ($o_distro_type) = @_; + unless (keys %mirrors) { #- contact the following URL to retrieve list of mirror. #- http://www.linux-mandrake.com/mirrorsfull.list @@ -54,9 +56,9 @@ sub mirrors() { local $SIG{ALRM} = sub { die "timeout" }; alarm 60; - my $type = $o->{distro_type} || 'updates'; + my $distro_type = $o_distro_type || 'updates'; foreach (<$f>) { - my ($arch, $url, $dir) = m|$type([^:]*):ftp://([^/]*)(/\S*)| or next; + my ($arch, $url, $dir) = m|$distro_type([^:]*):ftp://([^/]*)(/\S*)| or next; MDK::Common::System::compat_arch($arch) or log::l("ignoring updates from $url because of incompatible arch: $arch"), next; my $land = N("United States"); @@ -76,12 +78,12 @@ sub mirrors() { } sub bestMirror { - my ($string) = @_; + my ($string, $o_distro_type) = @_; my %mirror2value; - foreach my $url (mirrors()) { + foreach my $url (mirrors($o_distro_type)) { my $value = 0; - my $cvalue = mirrors(); + my $cvalue = mirrors($o_distro_type); $mirror2value{$url} ||= 1 + $cvalue; foreach (@{$land2tzs{$mirrors{$url}[0]} || []}) { diff --git a/perl-install/install_steps_interactive.pm b/perl-install/install_steps_interactive.pm index 0922af7ab..02f032b8f 100644 --- a/perl-install/install_steps_interactive.pm +++ b/perl-install/install_steps_interactive.pm @@ -780,9 +780,10 @@ Do you want to install the updates ?")), eval { my @mirrors = do { my $_w = $o->wait_message('', N("Contacting Mandrake Linux web site to get the list of available mirrors...")); - crypto::mirrors() }; + crypto::mirrors($o->{distro_type}); + }; #- if no mirror have been found, use current time zone and propose among available. - $u->{mirror} ||= crypto::bestMirror($o->{timezone}{timezone}); + $u->{mirror} ||= crypto::bestMirror($o->{timezone}{timezone}, $o->{distro_type}); $o->ask_from_({ messages => N("Choose a mirror from which to get the packages"), cancel => N("Cancel"), }, [ { separator => '|', |