summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRafael Garcia-Suarez <rgarciasuarez@mandriva.org>2005-09-13 08:24:36 +0000
committerRafael Garcia-Suarez <rgarciasuarez@mandriva.org>2005-09-13 08:24:36 +0000
commit99ac989df64e5584088681aa98a95dbb92461699 (patch)
tree453e6fc70efbafac0ac4279b1bb0eb4cf8e8313b
parentb9d99b78e9b9f4dc76eac74971b77f462d2dfd5f (diff)
downloaddrakx-backup-do-not-use-99ac989df64e5584088681aa98a95dbb92461699.tar
drakx-backup-do-not-use-99ac989df64e5584088681aa98a95dbb92461699.tar.gz
drakx-backup-do-not-use-99ac989df64e5584088681aa98a95dbb92461699.tar.bz2
drakx-backup-do-not-use-99ac989df64e5584088681aa98a95dbb92461699.tar.xz
drakx-backup-do-not-use-99ac989df64e5584088681aa98a95dbb92461699.zip
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.
-rw-r--r--perl-install/crypto.pm9
1 files changed, 9 insertions, 0 deletions
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.