From a9b4725785936940a78c2e89dfd9ced2573094cd Mon Sep 17 00:00:00 2001 From: Zbigniew Jędrzejewski-Szmek Date: Sep 27 2023 16:02:52 +0000 Subject: Pull in more patches for keyboard layout matching --- diff --git a/0001-find_legacy_keymap-extend-variant-match-bonus-again.patch b/0001-find_legacy_keymap-extend-variant-match-bonus-again.patch new file mode 100644 index 0000000..02f6fc0 --- /dev/null +++ b/0001-find_legacy_keymap-extend-variant-match-bonus-again.patch @@ -0,0 +1,50 @@ +From 537c00c984910f417a2f2d4aad997f822060d4d1 Mon Sep 17 00:00:00 2001 +From: Adam Williamson +Date: Tue, 19 Sep 2023 16:06:26 -0700 +Subject: [PATCH] find_legacy_keymap: extend variant match bonus again + +If the column is "-" and the X context variant specifer only +contains commas, we should also give the match bonus. The variant +string is supposed to be a comma-separated list as long as the +list of layouts, so it's quite natural for consumers to be written +in such a way that they pass a string only containing commas if +there are multiple layouts and no variants. anaconda is a real +world case that does this. + +Signed-off-by: Adam Williamson +--- + src/locale/localed-util.c | 2 +- + src/locale/test-localed-util.c | 7 +++++++ + 2 files changed, 8 insertions(+), 1 deletion(-) + +diff --git a/src/locale/localed-util.c b/src/locale/localed-util.c +index eba13a2ac3..9b6949e14d 100644 +--- a/src/locale/localed-util.c ++++ b/src/locale/localed-util.c +@@ -839,7 +839,7 @@ int find_legacy_keymap(const X11Context *xc, char **ret) { + if (isempty(xc->model) || streq_ptr(xc->model, a[2])) { + matching++; + +- if (streq_ptr(xc->variant, a[3]) || (isempty(xc->variant) && streq(a[3], "-"))) { ++ if (streq_ptr(xc->variant, a[3]) || ((isempty(xc->variant) || streq_skip_trailing_chars(xc->variant, "", ",")) && streq(a[3], "-"))) { + matching++; + + if (streq_ptr(xc->options, a[4])) +diff --git a/src/locale/test-localed-util.c b/src/locale/test-localed-util.c +index f702ff29b0..e92c178a98 100644 +--- a/src/locale/test-localed-util.c ++++ b/src/locale/test-localed-util.c +@@ -185,6 +185,13 @@ TEST(x11_convert_to_vconsole) { + assert_se(streq(vc.keymap, "bg_bds-utf8")); + vc_context_clear(&vc); + ++ /* same, but with variant specified as "," */ ++ log_info("/* test with variant as ',', desired match second (bg,us:) */"); ++ assert_se(free_and_strdup(&xc.variant, ",") >= 0); ++ assert_se(x11_convert_to_vconsole(&xc, &vc) >= 0); ++ assert_se(streq(vc.keymap, "bg_bds-utf8")); ++ vc_context_clear(&vc); ++ + log_info("/* test with old mapping (fr:latin9) */"); + assert_se(free_and_strdup(&xc.layout, "fr") >= 0); + assert_se(free_and_strdup(&xc.variant, "latin9") >= 0); diff --git a/0001-keyboard-model-map-correct-sk-qwerty-entry.patch b/0001-keyboard-model-map-correct-sk-qwerty-entry.patch new file mode 100644 index 0000000..f6a042a --- /dev/null +++ b/0001-keyboard-model-map-correct-sk-qwerty-entry.patch @@ -0,0 +1,25 @@ +From ca831de1704f4e28241df513aa89ac465a7c8ab2 Mon Sep 17 00:00:00 2001 +From: Adam Williamson +Date: Wed, 20 Sep 2023 15:14:31 -0700 +Subject: [PATCH] keyboard-model-map: correct sk-qwerty entry + +qwerty here is a variant, not an option. + +Signed-off-by: Adam Williamson +--- + src/locale/kbd-model-map | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/locale/kbd-model-map b/src/locale/kbd-model-map +index a145e13ecd..279d1a36d8 100644 +--- a/src/locale/kbd-model-map ++++ b/src/locale/kbd-model-map +@@ -52,7 +52,7 @@ es es pc105 - terminate:ctrl_alt_bksp + ro-cedilla ro pc105 cedilla terminate:ctrl_alt_bksp + ie ie pc105 - terminate:ctrl_alt_bksp + et ee pc105 - terminate:ctrl_alt_bksp +-sk-qwerty sk pc105 - terminate:ctrl_alt_bksp,qwerty ++sk-qwerty sk pc105 qwerty terminate:ctrl_alt_bksp + sk-qwertz sk pc105 - terminate:ctrl_alt_bksp + fr-latin9 fr pc105 latin9 terminate:ctrl_alt_bksp + fr_CH-latin1 ch pc105 fr terminate:ctrl_alt_bksp diff --git a/systemd.spec b/systemd.spec index dd6664b..b2d550a 100644 --- a/systemd.spec +++ b/systemd.spec @@ -112,11 +112,13 @@ Patch0002: https://github.com/systemd/systemd/pull/28521/commits/631d2b05ec # https://bugzilla.redhat.com/show_bug.cgi?id=1912609 Patch0003: 0001-find_legacy_keymap-fix-empty-variant-matching.patch Patch0004: 0002-find_legacy_keymap-try-matching-with-layout-order-re.patch +Patch0005: 0001-find_legacy_keymap-extend-variant-match-bonus-again.patch +Patch0006: 0001-keyboard-model-map-correct-sk-qwerty-entry.patch # Requested as an alternative to https://fedoraproject.org/wiki/Changes/Drop_Sshd_Socket -Patch0005: 0001-core-add-new-PollLimit-settings-to-.socket-units.patch -Patch0006: 0002-man-document-the-new-PollLimitIntervalSec-PollLimitB.patch -Patch0007: 0003-ci-add-test-for-poll-limit.patch +Patch0010: 0001-core-add-new-PollLimit-settings-to-.socket-units.patch +Patch0011: 0002-man-document-the-new-PollLimitIntervalSec-PollLimitB.patch +Patch0012: 0003-ci-add-test-for-poll-limit.patch # Those are downstream-only patches, but we don't want them in packit builds: # https://bugzilla.redhat.com/show_bug.cgi?id=1738828