Francois Gouget : testbot/LibvirtTool: Add support for UTF-8 and Unicode-only locales.
Alexandre Julliard
julliard at winehq.org
Wed Feb 16 15:28:34 CST 2022
Module: tools
Branch: master
Commit: da9dbcdb9d6017eb0d3cbf80f00c344b0b7e23fd
URL: https://source.winehq.org/git/tools.git/?a=commit;h=da9dbcdb9d6017eb0d3cbf80f00c344b0b7e23fd
Author: Francois Gouget <fgouget at codeweavers.com>
Date: Wed Feb 16 20:11:27 2022 +0100
testbot/LibvirtTool: Add support for UTF-8 and Unicode-only locales.
Adding '-u8' to a snapshot name sets the code pages to UTF-8 and allows
using a Unicode-only locale as the Windows system locale.
Signed-off-by: Francois Gouget <fgouget at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
testbot/bin/LibvirtTool.pl | 28 ++++++++++++++++++----------
1 file changed, 18 insertions(+), 10 deletions(-)
diff --git a/testbot/bin/LibvirtTool.pl b/testbot/bin/LibvirtTool.pl
index 481d0bd..10af2f8 100755
--- a/testbot/bin/LibvirtTool.pl
+++ b/testbot/bin/LibvirtTool.pl
@@ -560,7 +560,7 @@ sub GetSnapshotConfig($)
{
$Config->{locale} ||= $1; # take only the last match
}
- elsif ($Config->{base} =~ s/-(live)$//)
+ elsif ($Config->{base} =~ s/-(live|u8)$//)
{
$Config->{$1} = 1;
}
@@ -614,20 +614,28 @@ sub CreateSnapshot($$$$)
# A side effect is that it will force TestAgentd.exe.old to stay around.
}
- if ($Config->{locale})
+ my @Locale;
+ push @Locale, $Config->{locale} if ($Config->{locale});
+ push @Locale, $Config->{u8} if ($Config->{u8});
+ if (@Locale)
{
- Debug(Elapsed($Start), " Setting up the $Config->{locale} locale on $VMKey\n");
- # SetWinLocale --default performs a reboot and WaitForBoot()
- ResetBootCount($TA);
+ Debug(Elapsed($Start), " Setting up the @Locale locale on $VMKey\n");
+ my @Cmd = ("$BinDir/SetWinLocale", $VM->Hostname);
+ if ($Config->{locale})
+ {
+ push @Cmd, "--default", $Config->{locale};
+ # SetWinLocale --default performs a reboot and WaitForBoot()
+ ResetBootCount($TA);
+ $Booting = 1;
+ }
+ push @Cmd, "--utf8" if ($Config->{u8});
+ push @Cmd, "--debug" if ($Debug);
$TA->Disconnect();
- $Booting = 1;
- my @Cmd = ("$BinDir/SetWinLocale", $VM->Hostname, "--default", $Config->{locale});
- push @Cmd, "--debug" if ($Debug);
- Debug("Running: ", join(" ", @Cmd), "\n");
+ Debug("Running: @Cmd\n");
if (system(@Cmd))
{
- FatalError("Could not set the $VMKey locale to $Config->{locale}\n");
+ FatalError("Could not set the $VMKey locale to @Locale\n");
}
}
More information about the wine-cvs
mailing list