diff options
author | Rafael Garcia-Suarez <rgarciasuarez@mandriva.org> | 2004-09-13 05:39:52 +0000 |
---|---|---|
committer | Rafael Garcia-Suarez <rgarciasuarez@mandriva.org> | 2004-09-13 05:39:52 +0000 |
commit | 911218913fc33bc8155782a2c26cb92bbd9dae2a (patch) | |
tree | 793a34c39dafcd5b3bd448dba10f4a8eb9164e63 /perl-install/install_steps_interactive.pm | |
parent | 5608636beed65eb169ad1ebe4d58411f15d9b400 (diff) | |
download | drakx-911218913fc33bc8155782a2c26cb92bbd9dae2a.tar drakx-911218913fc33bc8155782a2c26cb92bbd9dae2a.tar.gz drakx-911218913fc33bc8155782a2c26cb92bbd9dae2a.tar.bz2 drakx-911218913fc33bc8155782a2c26cb92bbd9dae2a.tar.xz drakx-911218913fc33bc8155782a2c26cb92bbd9dae2a.zip |
Ability to choose from the mirror list when assing an ftp supplementary
media. Fix download of hdlists file for ftp supplementary media.
Diffstat (limited to 'perl-install/install_steps_interactive.pm')
-rw-r--r-- | perl-install/install_steps_interactive.pm | 32 |
1 files changed, 31 insertions, 1 deletions
diff --git a/perl-install/install_steps_interactive.pm b/perl-install/install_steps_interactive.pm index 036ac87fe..838750637 100644 --- a/perl-install/install_steps_interactive.pm +++ b/perl-install/install_steps_interactive.pm @@ -1,7 +1,6 @@ package install_steps_interactive; # $Id$ -use diagnostics; use strict; use vars qw(@ISA $new_bootstrap); @@ -396,6 +395,37 @@ sub deselectFoundMedia { my ($o, $p) = @_; install_any::deselectFoundMedia($o, $p); } + +sub mirror2text { $crypto::mirrors{$_[0]} ? $crypto::mirrors{$_[0]}[0] . '|' . $_[0] : "-|URL" } +sub askSupplMirror { + my ($o, $message) = @_; + my $u = $o->{updates} ||= {}; + require crypto; + my @mirrors = do { + my $_w = $o->wait_message('', N("Contacting Mandrakelinux web site to get the list of available mirrors...")); + crypto::mirrors($o->{distro_type}); + }; + push @mirrors, '-'; + $o->ask_from_( + { + messages => N("Choose a mirror from which to get the packages"), + cancel => N("Cancel"), + }, + [ { separator => '|', + format => \&mirror2text, + list => \@mirrors, + val => \$u->{mirror}, + }, ], + ) or $u->{mirror} = ''; + if ($u->{mirror} eq '-') { + return $o->ask_from_entry('', $message) || ''; + } + my $url = "ftp://$u->{mirror}$crypto::mirrors{$u->{mirror}}[1]"; + $url =~ s/\bmedia\/?$//; + log::l("mirror chosen [$url]"); + return $url; +} + sub selectSupplMedia { my ($o, $suppl_method) = @_; install_any::selectSupplMedia($o, $suppl_method); |