1
1
mirror of https://github.com/systemd/systemd-stable.git synced 2025-01-08 21:17:47 +03:00

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
This commit is contained in:
Luca Boccassi 2023-01-24 17:18:31 +00:00 committed by Zbigniew Jędrzejewski-Szmek
parent 246fd4d2ed
commit 1fd579061a
2 changed files with 36 additions and 36 deletions

View 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;

View File

@ -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)