]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
locale: rename new XKB variables to match Debian/Ubuntu's
authorLuca Boccassi <bluca@debian.org>
Tue, 24 Jan 2023 17:18:31 +0000 (17:18 +0000)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Tue, 24 Jan 2023 21:09:58 +0000 (22:09 +0100)
Debian/Ubuntu use almost the same variables, but without '_'. Given
our usage is new, rename them so that they match and downstream tech
debt can be removed.

Follow-up for https://github.com/systemd/systemd/pull/25805

See:
 https://github.com/systemd/systemd/issues/24228
 https://github.com/systemd/systemd/pull/25412

src/locale/localed-util.c
test/units/testsuite-73.sh

index 003663054c9e21cf560c0a5ff8d88325e11bccb6..e742a8d0b156e79260e739fd69a904ae7c68441e 100644 (file)
@@ -243,10 +243,10 @@ int vconsole_read_data(Context *c, sd_bus_message *m) {
         return parse_env_file_fd(fd, "/etc/vconsole.conf",
                                  "KEYMAP",        &c->vc_keymap,
                                  "KEYMAP_TOGGLE", &c->vc_keymap_toggle,
-                                 "XKB_LAYOUT",    &c->x11_from_vc.layout,
-                                 "XKB_MODEL",     &c->x11_from_vc.model,
-                                 "XKB_VARIANT",   &c->x11_from_vc.variant,
-                                 "XKB_OPTIONS",   &c->x11_from_vc.options);
+                                 "XKBLAYOUT",     &c->x11_from_vc.layout,
+                                 "XKBMODEL",      &c->x11_from_vc.model,
+                                 "XKBVARIANT",    &c->x11_from_vc.variant,
+                                 "XKBOPTIONS",    &c->x11_from_vc.options);
 }
 
 int x11_read_data(Context *c, sd_bus_message *m) {
@@ -388,19 +388,19 @@ int vconsole_write_data(Context *c) {
         if (r < 0)
                 return r;
 
-        r = strv_env_assign(&l, "XKB_LAYOUT", xc ? empty_to_null(xc->layout) : NULL);
+        r = strv_env_assign(&l, "XKBLAYOUT", xc ? empty_to_null(xc->layout) : NULL);
         if (r < 0)
                 return r;
 
-        r = strv_env_assign(&l, "XKB_MODEL", xc ? empty_to_null(xc->model) : NULL);
+        r = strv_env_assign(&l, "XKBMODEL", xc ? empty_to_null(xc->model) : NULL);
         if (r < 0)
                 return r;
 
-        r = strv_env_assign(&l, "XKB_VARIANT", xc ? empty_to_null(xc->variant) : NULL);
+        r = strv_env_assign(&l, "XKBVARIANT", xc ? empty_to_null(xc->variant) : NULL);
         if (r < 0)
                 return r;
 
-        r = strv_env_assign(&l, "XKB_OPTIONS", xc ? empty_to_null(xc->options) : NULL);
+        r = strv_env_assign(&l, "XKBOPTIONS", xc ? empty_to_null(xc->options) : NULL);
         if (r < 0)
                 return r;
 
index 49fc0434e596579037abcc871e545d086d9fac1b..92576c5067562633f793a6724fa9ab4fa61936c8 100755 (executable)
@@ -258,30 +258,30 @@ test_vc_keymap() {
             assert_not_in "X11 Variant:" "$output"
             assert_in "X11 Options: terminate:ctrl_alt_bksp" "$output"
 
-            assert_in "XKB_LAYOUT=us" "$vc"
-            assert_in "XKB_MODEL=pc105\+inet" "$vc"
-            assert_not_in "XKB_VARIANT" "$vc"
-            assert_in "XKB_OPTIONS=terminate:ctrl_alt_bksp" "$vc"
+            assert_in "XKBLAYOUT=us" "$vc"
+            assert_in "XKBMODEL=pc105\+inet" "$vc"
+            assert_not_in "XKBVARIANT" "$vc"
+            assert_in "XKBOPTIONS=terminate:ctrl_alt_bksp" "$vc"
         elif [[ "$i" == "us-acentos" ]]; then
             assert_in "X11 Layout: us" "$output"
             assert_in 'X11 Model: pc105$' "$output"
             assert_in "X11 Variant: intl" "$output"
             assert_in "X11 Options: terminate:ctrl_alt_bksp" "$output"
 
-            assert_in "XKB_LAYOUT=us" "$vc"
-            assert_in "XKB_MODEL=pc105$" "$vc"
-            assert_in "XKB_VARIANT=intl" "$vc"
-            assert_in "XKB_OPTIONS=terminate:ctrl_alt_bksp" "$vc"
+            assert_in "XKBLAYOUT=us" "$vc"
+            assert_in "XKBMODEL=pc105$" "$vc"
+            assert_in "XKBVARIANT=intl" "$vc"
+            assert_in "XKBOPTIONS=terminate:ctrl_alt_bksp" "$vc"
         elif [[ "$i" =~ ^us-.* ]]; then
             assert_in "X11 Layout: .unset." "$output"
             assert_not_in "X11 Model:" "$output"
             assert_not_in "X11 Variant:" "$output"
             assert_not_in "X11 Options:" "$output"
 
-            assert_not_in "XKB_LAYOUT" "$vc"
-            assert_not_in "XKB_MODEL" "$vc"
-            assert_not_in "XKB_VARIANT" "$vc"
-            assert_not_in "XKB_OPTIONS" "$vc"
+            assert_not_in "XKBLAYOUT" "$vc"
+            assert_not_in "XKBMODEL" "$vc"
+            assert_not_in "XKBVARIANT" "$vc"
+            assert_not_in "XKBOPTIONS" "$vc"
         fi
     done
 
@@ -322,10 +322,10 @@ XKBOPTIONS=terminate:ctrl_alt_bksp"
         assert_in 'Option "XkbOptions" "terminate:ctrl_alt_bksp"' "$output"
 
         output=$(cat /etc/vconsole.conf)
-        assert_in 'XKB_LAYOUT=us' "$output"
-        assert_in 'XKB_MODEL=pc105\+inet' "$output"
-        assert_in 'XKB_VARIANT=intl' "$output"
-        assert_in 'XKB_OPTIONS=terminate:ctrl_alt_bksp' "$output"
+        assert_in 'XKBLAYOUT=us' "$output"
+        assert_in 'XKBMODEL=pc105\+inet' "$output"
+        assert_in 'XKBVARIANT=intl' "$output"
+        assert_in 'XKBOPTIONS=terminate:ctrl_alt_bksp' "$output"
     fi
 
     output=$(localectl)
@@ -352,10 +352,10 @@ XKBVARIANT=intl"
         assert_not_in 'Option "XkbOptions"' "$output"
 
         output=$(cat /etc/vconsole.conf)
-        assert_in 'XKB_LAYOUT=us' "$output"
-        assert_in 'XKB_MODEL=pc105\+inet' "$output"
-        assert_in 'XKB_VARIANT=intl' "$output"
-        assert_not_in 'XKB_OPTIONS' "$output"
+        assert_in 'XKBLAYOUT=us' "$output"
+        assert_in 'XKBMODEL=pc105\+inet' "$output"
+        assert_in 'XKBVARIANT=intl' "$output"
+        assert_not_in 'XKBOPTIONS' "$output"
     fi
 
     output=$(localectl)
@@ -381,10 +381,10 @@ XKBMODEL=pc105+inet"
         assert_not_in 'Option "XkbOptions"' "$output"
 
         output=$(cat /etc/vconsole.conf)
-        assert_in 'XKB_LAYOUT=us' "$output"
-        assert_in 'XKB_MODEL=pc105\+inet' "$output"
-        assert_not_in 'XKB_VARIANT' "$output"
-        assert_not_in 'XKB_OPTIONS' "$output"
+        assert_in 'XKBLAYOUT=us' "$output"
+        assert_in 'XKBMODEL=pc105\+inet' "$output"
+        assert_not_in 'XKBVARIANT' "$output"
+        assert_not_in 'XKBOPTIONS' "$output"
     fi
 
     output=$(localectl)
@@ -409,10 +409,10 @@ XKBMODEL=pc105+inet"
         assert_not_in 'Option "XkbOptions"' "$output"
 
         output=$(cat /etc/vconsole.conf)
-        assert_in 'XKB_LAYOUT=us' "$output"
-        assert_not_in 'XKB_MODEL' "$output"
-        assert_not_in 'XKB_VARIANT' "$output"
-        assert_not_in 'XKB_OPTIONS' "$output"
+        assert_in 'XKBLAYOUT=us' "$output"
+        assert_not_in 'XKBMODEL' "$output"
+        assert_not_in 'XKBVARIANT' "$output"
+        assert_not_in 'XKBOPTIONS' "$output"
     fi
 
     output=$(localectl)