From: Luca Boccassi Date: Tue, 24 Jan 2023 17:18:31 +0000 (+0000) Subject: locale: rename new XKB variables to match Debian/Ubuntu's X-Git-Tag: v253-rc1~3 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1fd579061af123a74a034cf3593c0fd96d866b68;p=thirdparty%2Fsystemd.git locale: rename new XKB variables to match Debian/Ubuntu's 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 --- diff --git a/src/locale/localed-util.c b/src/locale/localed-util.c index 003663054c9..e742a8d0b15 100644 --- a/src/locale/localed-util.c +++ b/src/locale/localed-util.c @@ -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; diff --git a/test/units/testsuite-73.sh b/test/units/testsuite-73.sh index 49fc0434e59..92576c50675 100755 --- a/test/units/testsuite-73.sh +++ b/test/units/testsuite-73.sh @@ -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)