From 99ac989df64e5584088681aa98a95dbb92461699 Mon Sep 17 00:00:00 2001 From: Rafael Garcia-Suarez Date: Tue, 13 Sep 2005 08:24:36 +0000 Subject: When selecting mirrors in the mirror list, if we find a mirror with the exact same architecture than the current one, discard all other mirrors. This should avoid listing i586 mirrors when installing on x86_64. --- perl-install/crypto.pm | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'perl-install') diff --git a/perl-install/crypto.pm b/perl-install/crypto.pm index 48422b2fd..19fe7d397 100644 --- a/perl-install/crypto.pm +++ b/perl-install/crypto.pm @@ -101,15 +101,24 @@ sub mirrors { $o_use_local_list or alarm 60; my $distro_type = $o_distro_type || 'updates'; my $sub_dir = $distro_type =~ /cooker|community/ ? '' : '/' . version() . '/main_updates'; + my $strict_arch; + my $our_arch = MDK::Common::System::arch(); + my %arch_mirror; foreach (<$f>) { my ($arch, $url, $dir) = m|$distro_type([^:]*):ftp://([^/]*)(/\S*)| or next; + defined $strict_arch && $arch eq $strict_arch or next; MDK::Common::System::compat_arch($arch) or next; + $arch eq $our_arch and $strict_arch = $arch; my $land = N("United States"); foreach (keys %url2land) { my $qu = quotemeta $_; $url =~ /\.$qu(?:\..*)?$/ and $land = $url2land{$_}; } $mirrors{$url} = [ $land, $dir . $sub_dir ]; + $arch_mirror{$url} = $arch; + } + if (defined $strict_arch) { + delete @mirrors{grep { $arch_mirror{$_} ne $strict_arch } keys %arch_mirror}; } unless ($o_use_local_list) { http::getFile('/XXX'); #- close connection. -- cgit v1.2.1