summaryrefslogtreecommitdiffstats
path: root/perl-install
diff options
context:
space:
mode:
Diffstat (limited to 'perl-install')
-rw-r--r--perl-install/install_steps_interactive.pm9
-rw-r--r--perl-install/timezone.pm74
2 files changed, 43 insertions, 40 deletions
diff --git a/perl-install/install_steps_interactive.pm b/perl-install/install_steps_interactive.pm
index e2f01cf95..3c9107c84 100644
--- a/perl-install/install_steps_interactive.pm
+++ b/perl-install/install_steps_interactive.pm
@@ -830,12 +830,13 @@ sub configureTimezone {
]) or goto &configureTimezone
if $::expert || $clicked;
if ($ntp) {
- my @servers = split("\n", timezone::ntp_servers());
+ my $servers = timezone::ntp_servers();
+ $o->{timezone}{ntp} ||= 'pool.ntp.org';
- $o->ask_from_({},
- [ { label => N("NTP Server"), val => \$o->{timezone}{ntp}, list => \@servers, not_edit => 0 } ]
+ $in->ask_from_({},
+ [ { label => N("NTP Server"), val => \$o->{timezone}{ntp}, list => [ keys %$servers ], not_edit => 0,
+ format => sub { $servers->{$_[0]} ? "$servers->{$_[0]} ($_[0])" : $_[0] } } ]
) or goto &configureTimezone;
- $o->{timezone}{ntp} =~ s/.*\((.+)\)/$1/;
} else {
$o->{timezone}{ntp} = '';
}
diff --git a/perl-install/timezone.pm b/perl-install/timezone.pm
index dbce11f8d..b1377c81a 100644
--- a/perl-install/timezone.pm
+++ b/perl-install/timezone.pm
@@ -128,42 +128,44 @@ sub fuzzyChoice {
sub bestTimezone { $c2t{fuzzyChoice($_[0])} || 'GMT' }
sub ntp_servers() {
-q(Australia (ntp.adelaide.edu.au)
-Australia (ntp.saard.net)
-Australia (time.esec.com.au)
-Canada (ntp.cpsc.ucalgary.ca)
-Canada (ntp1.cmc.ec.gc.ca)
-Canada (ntp2.cmc.ec.gc.ca)
-Canada (time.chu.nrc.ca)
-Canada (time.nrc.ca)
-Canada (timelord.uregina.ca)
-Spain (slug.ctv.es)
-France (ntp.univ-lyon1.fr)
-Croatia (zg1.ntp.carnet.hr)
-Croatia (zg2.ntp.carnet.hr)
-Croatia (st.ntp.carnet.hr)
-Croatia (ri.ntp.carnet.hr)
-Croatia (os.ntp.carnet.hr)
-Indonesia (ntp.incaf.net)
-Italy (time.ien.it)
-Korea, republic of (time.nuri.net)
-Norway (fartein.ifi.uio.no)
-Russia (ntp.landau.ac.ru)
-Singapore (ntp.shim.org)
-Slovenia (time.ijs.si)
-United kingdom (ntp.cs.strath.ac.uk)
-United kingdom (ntp2a.mcc.ac.uk)
-United kingdom (ntp2b.mcc.ac.uk)
-United kingdom (ntp2c.mcc.ac.uk)
-United kingdom (ntp2d.mcc.ac.uk)
-United states DE (louie.udel.edu)
-United states IL (ntp-0.cso.uiuc.edu)
-United states IL (ntp-1.cso.uiuc.edu)
-United states IL (ntp-2.cso.uiuc.edu)
-United states IN (gilbreth.ecn.purdue.edu)
-United states IN (harbor.ecn.purdue.edu)
-United states IN (molecule.ecn.purdue.edu)
-);
+ +{
+ 'ntp.adelaide.edu.au' => 'Australia',
+ 'ntp.saard.net' => 'Australia',
+ 'time.esec.com.au' => 'Australia',
+ 'ntp.cpsc.ucalgary.ca' => 'Canada',
+ 'ntp1.cmc.ec.gc.ca' => 'Canada',
+ 'ntp2.cmc.ec.gc.ca' => 'Canada',
+ 'time.chu.nrc.ca' => 'Canada',
+ 'time.nrc.ca' => 'Canada',
+ 'timelord.uregina.ca' => 'Canada',
+ 'slug.ctv.es' => 'Spain',
+ 'ntp.univ-lyon1.fr' => 'France',
+ 'zg1.ntp.carnet.hr' => 'Croatia',
+ 'zg2.ntp.carnet.hr' => 'Croatia',
+ 'st.ntp.carnet.hr' => 'Croatia',
+ 'ri.ntp.carnet.hr' => 'Croatia',
+ 'os.ntp.carnet.hr' => 'Croatia',
+ 'ntp.incaf.net' => 'Indonesia',
+ 'time.ien.it' => 'Italy',
+ 'time.nuri.net' => 'Korea, republic of',
+ 'fartein.ifi.uio.no' => 'Norway',
+ 'ntp.landau.ac.ru' => 'Russia',
+ 'ntp.shim.org' => 'Singapore',
+ 'time.ijs.si' => 'Slovenia',
+ 'ntp.cs.strath.ac.uk' => 'United kingdom',
+ 'ntp2a.mcc.ac.uk' => 'United kingdom',
+ 'ntp2b.mcc.ac.uk' => 'United kingdom',
+ 'ntp2c.mcc.ac.uk' => 'United kingdom',
+ 'ntp2d.mcc.ac.uk' => 'United kingdom',
+ 'louie.udel.edu' => 'United states DE',
+ 'ntp-0.cso.uiuc.edu' => 'United states IL',
+ 'ntp-1.cso.uiuc.edu' => 'United states IL',
+ 'ntp-2.cso.uiuc.edu' => 'United states IL',
+ 'gilbreth.ecn.purdue.edu' => 'United states IN',
+ 'harbor.ecn.purdue.edu' => 'United states IN',
+ 'molecule.ecn.purdue.edu' => 'United states IN',
+ 'pool.ntp.org' => 'World Wide',
+ };
}
1;