Francois Gouget : testbot/SetWinLocale: Reorder the locales handling.

Alexandre Julliard julliard at winehq.org
Tue Jan 25 15:40:00 CST 2022


Module: tools
Branch: master
Commit: 1b54b035c68b7e0daf918c5470a6dc66cb8e7e0d
URL:    https://source.winehq.org/git/tools.git/?a=commit;h=1b54b035c68b7e0daf918c5470a6dc66cb8e7e0d

Author: Francois Gouget <fgouget at codeweavers.com>
Date:   Tue Jan 25 16:48:45 2022 +0100

testbot/SetWinLocale: Reorder the locales handling.

Signed-off-by: Francois Gouget <fgouget at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 testbot/bin/SetWinLocale | 49 ++++++++++++++++++++++++------------------------
 1 file changed, 24 insertions(+), 25 deletions(-)

diff --git a/testbot/bin/SetWinLocale b/testbot/bin/SetWinLocale
index 8d8f866..0b034b7 100755
--- a/testbot/bin/SetWinLocale
+++ b/testbot/bin/SetWinLocale
@@ -293,7 +293,7 @@ sub CheckLocale($$)
 }
 
 my ($OptHostName, $OptShow, $OptReboot);
-my ($OptDefault, $OptLocale, $OptSystem, $OptMUI, $OptCountry, $OptKeyboard, $OptUTF8);
+my ($OptDefault, $OptLocale, $OptCountry, $OptSystem, $OptUTF8, $OptMUI, $OptKeyboard);
 while (@ARGV)
 {
   my $Arg = shift @ARGV;
@@ -331,10 +331,18 @@ while (@ARGV)
   {
     $OptLocale = CheckLocale($Arg, $OptLocale);
   }
+  elsif ($Arg eq "--country")
+  {
+    $OptCountry = CheckValue($Arg, $OptCountry);
+  }
   elsif ($Arg eq "--system")
   {
     $OptSystem = CheckLocale($Arg, $OptSystem);
   }
+  elsif ($Arg eq "--utf8")
+  {
+    $OptUTF8 = 1;
+  }
   elsif ($Arg eq "--mui")
   {
     $OptMUI = CheckLocale($Arg, $OptMUI);
@@ -343,14 +351,6 @@ while (@ARGV)
   {
     $OptKeyboard = CheckLocale($Arg, $OptKeyboard);
   }
-  elsif ($Arg eq "--country")
-  {
-    $OptCountry = CheckValue($Arg, $OptCountry);
-  }
-  elsif ($Arg eq "--utf8")
-  {
-    $OptUTF8 = 1;
-  }
   elsif ($Arg eq "--debug")
   {
     $Debug = 1;
@@ -429,7 +429,7 @@ if (defined $Usage)
     exit $Usage;
   }
   print "Usage: $name0 [options] --show HOSTNAME\n";
-  print "or     $name0 [options] [--default DEF] [--locale LOC] [--system SYS] [--utf8] [--mui MUI] [--keyboard KBD] [--country CTY] HOSTNAME\n";
+  print "or     $name0 [options] [--default DEF] [--locale LOC] [--country CTY] [--system SYS] [--utf8] [--mui MUI] [--keyboard KBD] [--no-reboot] HOSTNAME\n";
   print "\n";
   print "Sets the locale of the specified Windows machine.\n";
   print "\n";
@@ -446,6 +446,11 @@ if (defined $Usage)
   print "                   format.\n";
   print "                 . APIs: GetUserDefaultLCID().\n";
   print "                 . Powershell: Set-Culture LOC\n";
+  print "  --country CTY  Specifies the location using only the country part of the\n";
+  print "                 Windows locale (see --defaults).\n";
+  print "                 . Windows 10 GUI: Time & language -> Region -> Country.\n";
+  print "                 . APIs: GetUserGeoID().\n";
+  print "                 . Powershell: Set-WinHomeLocation -GeoId CTY-ID\n";
   print "  --system SYS   Specifies the system locale (see --defaults).\n";
   print "                 . Only takes effect after a reboot.\n";
   print "                 . Windows 10 GUI: Time & language -> Language ->\n";
@@ -470,11 +475,6 @@ if (defined $Usage)
   print "                 . Windows 10 GUI: Time & language -> Language -> Keyboard ->\n";
   print "                   Override for default input method.\n";
   print "                 . Powershell: Set-WinDefaultInputMethodOverride -InputTip KBD-ID\n";
-  print "  --country CTY  Specifies the location using only the country part of the\n";
-  print "                 Windows locale (see --defaults).\n";
-  print "                 . Windows 10 GUI: Time & language -> Region -> Country.\n";
-  print "                 . APIs: GetUserGeoID().\n";
-  print "                 . Powershell: Set-WinHomeLocation -GeoId CTY-ID\n";
   print "  --no-reboot    Do not reboot Windows. Some locale changes will only take\n";
   print "                 effect after the next reboot.\n";
   print "  --debug        Show more detailed information about progress.\n";
@@ -870,14 +870,6 @@ if ($OptLocale)
   CheckSetting($Settings, "Locale", "0000$LCIDLocale", "for --locale $OptLocale", 1);
   CheckSetting($Settings, "LocaleName", $OptLocale, "for --locale $OptLocale");
 }
-if ($KeyboardIds)
-{
-  CheckSetting($Settings, "InputMethod", $KeyboardIds->[0], "for --keyboard $OptKeyboard", 1);
-}
-if ($OptMUI)
-{
-  CheckSetting($Settings, "PreferredUILanguages", $OptMUI, "for --mui $OptMUI");
-}
 if ($OptCountry)
 {
   CheckSetting($Settings, "Country", $CountryId, "for --country $OptCountry");
@@ -895,8 +887,15 @@ if ($OptUTF8)
     CheckSetting($Settings, $VName, "65001", "for --utf8");
   }
 }
-exit(1) if (!$Success);
-
+if ($OptMUI)
+{
+  CheckSetting($Settings, "PreferredUILanguages", $OptMUI, "for --mui $OptMUI");
+}
+if ($KeyboardIds)
+{
+  CheckSetting($Settings, "InputMethod", $KeyboardIds->[0], "for --keyboard $OptKeyboard", 1);
+}
 
+exit(1) if (!$Success);
 Debug(Elapsed($Start), " All done!\n");
 exit(0);




More information about the wine-cvs mailing list