aboutsummaryrefslogtreecommitdiffstats
path: root/lib/AdminPanel/rpmdragora.pm
diff options
context:
space:
mode:
authorAngelo Naselli <anaselli@linux.it>2014-07-19 16:13:30 +0200
committerAngelo Naselli <anaselli@linux.it>2014-07-19 16:13:30 +0200
commit1874d411afff246a7eea2e3fac58d32138d133d5 (patch)
tree79b5f5b73e6b891e742336a70dc37899a7774ae2 /lib/AdminPanel/rpmdragora.pm
parent960d077ea986538fc5b92a3918265ab822344299 (diff)
downloadcolin-keep-1874d411afff246a7eea2e3fac58d32138d133d5.tar
colin-keep-1874d411afff246a7eea2e3fac58d32138d133d5.tar.gz
colin-keep-1874d411afff246a7eea2e3fac58d32138d133d5.tar.bz2
colin-keep-1874d411afff246a7eea2e3fac58d32138d133d5.tar.xz
colin-keep-1874d411afff246a7eea2e3fac58d32138d133d5.zip
- Used character "|" as separator
- correct translation of timezones
Diffstat (limited to 'lib/AdminPanel/rpmdragora.pm')
-rw-r--r--lib/AdminPanel/rpmdragora.pm15
1 files changed, 9 insertions, 6 deletions
diff --git a/lib/AdminPanel/rpmdragora.pm b/lib/AdminPanel/rpmdragora.pm
index 77a5481..ec1d296 100644
--- a/lib/AdminPanel/rpmdragora.pm
+++ b/lib/AdminPanel/rpmdragora.pm
@@ -492,12 +492,13 @@ my %u2l = (
tw => N_("Taiwan"),
uk => N_("United Kingdom"),
cn => N_("China"),
+ us => N_("United States"),
com => N_("United States"),
org => N_("United States"),
net => N_("United States"),
edu => N_("United States"),
);
-my $us = [ qw(com org net edu) ];
+my $us = [ qw(us com org net edu) ];
my %t2l = (
'America/\w+' => $us,
'Asia/Tel_Aviv' => [ qw(il ru it cz at de fr se) ],
@@ -890,6 +891,7 @@ sub choose_mirror {
my @transient_options = exists $options{transient} ? (transient => $options{transient}) : ();
warn_for_network_need($options{message}, %options) or return;
my @mirrors = eval { mirrors($urpm, $options{want_base_distro}) };
+$DB::single = 1;
my $error = $@;
if ($error) {
$error = "\n$error\n";
@@ -914,13 +916,14 @@ the case when the architecture of your processor is not supported
by Mageia Official Updates.")), %options
), return '';
- my @mirrorlist = map {$_->{country} . "-" . $_->{url}} @mirrors;
+ my @mirrorlist = map {$_->{country} . "|" . $_->{url}} @mirrors;
+ $DB::single=1;
my $sh_gui = AdminPanel::Shared::GUI->new();
my $mirror = $sh_gui->ask_fromTreeList({title => N("Mirror choice"),
header => N("Please choose the desired mirror."),
default_button => 1,
- item_separator => "-",
+ item_separator => "|",
default_item => $mirrors[0]->{url},
list => \@mirrorlist }
);
@@ -1053,12 +1056,12 @@ sub mirrors {
require AdminPanel::Shared::TimeZone;
my $tzo = AdminPanel::Shared::TimeZone->new();
my $tz = $tzo->readConfiguration()->{ZONE};
-
+$DB::single =1;
foreach my $mirror (@mirrors) {
my $goodness;
- each_index { $_ = $u2l{$_} || $_; $_ eq $mirror->{country} and $goodness ||= 100-$::i } (map { if_($tz =~ /^$_$/, @{$t2l{$_}}) } keys %t2l), @$us;
+ each_index { $_ = $u2l{$_} || $_; $_ eq lc($mirror->{country}) and $goodness ||= 100-$::i } (map { if_($tz =~ /^$_$/, @{$t2l{$_}}) } keys %t2l), @$us;
$mirror->{goodness} = $goodness + rand();
- $mirror->{country} = translate($mirror->{country});
+ $mirror->{country} = $u2l{lc($mirror->{country})} ? translate($u2l{lc($mirror->{country})}) : $mirror->{country};
}
unless (-x '/usr/bin/rsync') {
@mirrors = grep { $_->{url} !~ /^rsync:/ } @mirrors;