[pve-devel] applied: [PATCH installer] run env: use default error message if country detection failed with empty string

Thomas Lamprecht t.lamprecht at proxmox.com
Mon Apr 8 18:02:33 CEST 2024


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 at proxmox.com>
> ---
>  Proxmox/Install/RunEnv.pm | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
>

applied, thanks!




More information about the pve-devel mailing list