public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Christoph Heiss <c.heiss@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [pve-devel] [PATCH installer] fix #4430: add UTC timezone as option to installer
Date: Wed, 15 Mar 2023 13:26:36 +0100	[thread overview]
Message-ID: <20230315122635.286988-1-c.heiss@proxmox.com> (raw)

The 'Etc/UTC' timezone does not have a definite 2-letter country code
assigned. 'xx' was choosen on the basis that this hopefully will never
be assigned to any real country in the future, but a small collision
check won't hurt either.

This also means it does not have an entry in either the ISO-codes
definition file nor the zoneinfo table, thus needing to define it
manually.

Using just 'UTC' as timezone (name) also matches what PVE/PMG/PBS do in
their UI.

Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
---
Some bike-shedding: If there is a better suggestion on what country code
to choose, I'll happily change it.

Also, although the correct timezone name is 'Etc/UTC', I chose 'UTC' as
"country name" to display in the installer to make it easier to find for
users, as they probably will just type 'UTC' in there at first, rather
than 'Etc'.

 country.pl  | 4 ++++
 proxinstall | 4 ++++
 2 files changed, 8 insertions(+)

diff --git a/country.pl b/country.pl
index b1a2d62..ffa47d2 100755
--- a/country.pl
+++ b/country.pl
@@ -72,3 +72,7 @@ foreach my $cc (sort keys %$country) {
     my $mir = $mirrors->{$cc} || '';
     print "$cc:$country->{$cc}:$map:$mir:\n";
 }
+
+die "UTC fake country code collision: $country->{xx}\n"
+    if defined($country->{xx});
+print "xx:UTC:::\n";
diff --git a/proxinstall b/proxinstall
index 79abc34..9000178 100755
--- a/proxinstall
+++ b/proxinstall
@@ -690,6 +690,10 @@ sub read_cmap {
     }
     close ($TMP);

+    $cczones->{xx}->{UTC} = 1;
+    $country->{xx}->{zone} = 'UTC';
+    $zones->{UTC} = 1;
+
     return {
 	zones => $zones,
 	cczones => $cczones,
--
2.39.2





             reply	other threads:[~2023-03-15 12:27 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-15 12:26 Christoph Heiss [this message]
2023-03-15 13:23 ` Thomas Lamprecht
2023-03-16  9:17   ` Christoph Heiss

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230315122635.286988-1-c.heiss@proxmox.com \
    --to=c.heiss@proxmox.com \
    --cc=pve-devel@lists.proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal