From: Thomas Lamprecht <t.lamprecht@proxmox.com>
To: Proxmox VE development discussion <pve-devel@lists.proxmox.com>,
Christoph Heiss <c.heiss@proxmox.com>
Subject: [pve-devel] applied: [PATCH installer] run env: use default error message if country detection failed with empty string
Date: Mon, 8 Apr 2024 18:02:33 +0200 [thread overview]
Message-ID: <5dc60050-aeb7-41ec-9717-0d0f6947023c@proxmox.com> (raw)
In-Reply-To: <20240326133103.952802-1-c.heiss@proxmox.com>
Am 26/03/2024 um 14:29 schrieb Christoph Heiss:
> Bit of perl fun again.
> $err from detect_country_tracing_to() can be empty string under certain
> circumstances (according to a forum post [0]). The // operator
> evaluates an empty as true, thus `warn` receives an empty string to and
> just prints
>
> Warning: something wrong at /usr/share/perl5/proxmox/Install/RunEnv.pm line 305
>
> Which isn't particular helpful. Use the || operator instead, that
> evaluates an empty string as false and thus would fall back to the
> generic error message.
>
> A minimal reproducer/example for completeness sake:
>
> #!/usr/bin/env perl
> use strict;
> use warnings;
>
> warn ('' // "unable to detect country\n");
> warn ('' || "unable to detect country\n");
>
> gives
>
> Warning: something's wrong at ./test.pl line 5.
> unable to detect country
>
> [0] https://forum.proxmox.com/threads/blank-screen-while-installing.143928/
>
> Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
> ---
> Proxmox/Install/RunEnv.pm | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
>
applied, thanks!
prev parent reply other threads:[~2024-04-08 16:03 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-03-26 13:29 [pve-devel] " Christoph Heiss
2024-04-08 16:02 ` Thomas Lamprecht [this message]
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=5dc60050-aeb7-41ec-9717-0d0f6947023c@proxmox.com \
--to=t.lamprecht@proxmox.com \
--cc=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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal