summaryrefslogtreecommitdiffstats
path: root/perl-install
diff options
context:
space:
mode:
authorMartin Whitaker <mageia@martin-whitaker.me.uk>2026-01-15 13:56:07 +0000
committerMartin Whitaker <mageia@martin-whitaker.me.uk>2026-01-16 22:43:55 +0000
commit8b146d6547ee5cf8049a7566efd75cd1df8314e7 (patch)
tree3fd9c79d2946e17839820d591aee919c735424ed /perl-install
parent25f74ddb44213151a7547149e37b0b69a8308ff8 (diff)
downloaddrakx-8b146d6547ee5cf8049a7566efd75cd1df8314e7.tar
drakx-8b146d6547ee5cf8049a7566efd75cd1df8314e7.tar.gz
drakx-8b146d6547ee5cf8049a7566efd75cd1df8314e7.tar.bz2
drakx-8b146d6547ee5cf8049a7566efd75cd1df8314e7.tar.xz
drakx-8b146d6547ee5cf8049a7566efd75cd1df8314e7.zip
Fix timezone::ntp_servers() when it is called more than once.
The old implementation of get_ntp_server_tree() would add entries to %timezone for each leaf node it visited. So if ntp_servers() was called a second time, it would list those spurious entries. Fixed by stopping recursion immediately when a leaf node was found.
Diffstat (limited to 'perl-install')
-rw-r--r--perl-install/NEWS2
-rw-r--r--perl-install/install/NEWS2
-rw-r--r--perl-install/timezone.pm15
3 files changed, 11 insertions, 8 deletions
diff --git a/perl-install/NEWS b/perl-install/NEWS
index ff37b81f6..69d5f401b 100644
--- a/perl-install/NEWS
+++ b/perl-install/NEWS
@@ -1,3 +1,5 @@
+- fix timezone::ntp_servers() to return the correct list when called
+ more than once
- drakclock: use UTC instead of GMT in dialogue (mga#6056)
Version 18.71 - 5 January 2026
diff --git a/perl-install/install/NEWS b/perl-install/install/NEWS
index e2760be8c..a67d460fb 100644
--- a/perl-install/install/NEWS
+++ b/perl-install/install/NEWS
@@ -1,3 +1,5 @@
+- fix incorrect timezone list when configureTimezone() is called more
+ than once
- ask for user's timezone at the start of installation and correct the
system clock accordingly (mga#34909)
diff --git a/perl-install/timezone.pm b/perl-install/timezone.pm
index faf769054..a18914755 100644
--- a/perl-install/timezone.pm
+++ b/perl-install/timezone.pm
@@ -150,14 +150,13 @@ our %ntp_servers;
sub get_ntp_server_tree {
my ($zone) = @_;
map {
- $ntp_servers{$zone}{$_} => (
- exists $ntp_servers{$_} ?
- $zone ?
- translate($_) . "|" . N("All servers") :
- N("All servers") :
- translate($zone) . "|" . translate($_)
- ),
- get_ntp_server_tree($_);
+ my $key = $ntp_servers{$zone}{$_};
+ if (exists $ntp_servers{$_}) {
+ ( $key => $zone ? translate($_) . "|" . N("All servers") : N("All servers"),
+ get_ntp_server_tree($_) );
+ } else {
+ ( $key => translate($zone) . "|" . translate($_) );
+ }
} keys %{$ntp_servers{$zone}};
}