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 v2 installer] fix #4430: add UTC timezone as option to installer
Date: Thu, 16 Mar 2023 11:01:36 +0100	[thread overview]
Message-ID: <20230316100136.97432-1-c.heiss@proxmox.com> (raw)

Adds 'Etc/UTC' as option to the timezone selection, regardless of what
country is selected.

The 'Etc/' prefix needs to be stripped for the installation, as this
value is written to /etc/timezone. PVE/PMG/PBS already use 'UTC' without
the prefix, so avoid regressing them.

Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
---
Would it be sensible to fix up the timezone change component in the UI
so that it uses 'Etc/UTC' (which is the canonical timezone name for UTC)
as well? As separate patch in the future, of course.

v1: https://lists.proxmox.com/pipermail/pve-devel/2023-March/056202.html

 proxinstall | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/proxinstall b/proxinstall
index 79abc34..899b534 100755
--- a/proxinstall
+++ b/proxinstall
@@ -2658,6 +2658,7 @@ sub update_zonelist {

     $cb->signal_connect('changed' => sub {
 	$timezone = $cb->get_active_text();
+	$timezone =~ s|Etc/UTC|UTC|;
     });

     my @za;
@@ -2674,6 +2675,9 @@ sub update_zonelist {
 	$i++;
     }

+    # Append Etc/UTC here, so it is always the last item and never the default for any country.
+    $cb->append_text('Etc/UTC');
+
     $cb->set_active($ind || 0);

     $cb->show;
--
2.39.2





             reply	other threads:[~2023-03-16 10:01 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-16 10:01 Christoph Heiss [this message]
2023-03-16 11:33 ` [pve-devel] applied: " Thomas Lamprecht

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=20230316100136.97432-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