Thanks, applied as 604c6b5abe108a6989b41ca38980781ceff25ff7. Michael
[sent from post-receive hook] On Sat, 15 Jun 2024 16:58:50 +0200, Christian Melki <[email protected]> wrote: > Minor changes. > https://gitlab.freedesktop.org/xkeyboard-config/xkeyboard-config/-/commits/xkeyboard-config-2.42 > > * Add patch to remove changes in python script that would > require python 3.11 which isn't default in even Ubuntu 22.04. > Ie, revert: > https://gitlab.freedesktop.org/xkeyboard-config/xkeyboard-config/-/commit/809b7ad3003863476eb76a16e27ff7d00519f199 > > Signed-off-by: Christian Melki <[email protected]> > Message-Id: <[email protected]> > Signed-off-by: Michael Olbrich <[email protected]> > > diff --git > a/patches/xkeyboard-config-2.42/0001-revert-rules-minor-improvement-to-generation-script.patch > > b/patches/xkeyboard-config-2.42/0001-revert-rules-minor-improvement-to-generation-script.patch > new file mode 100644 > index 000000000000..9d14240da000 > --- /dev/null > +++ > b/patches/xkeyboard-config-2.42/0001-revert-rules-minor-improvement-to-generation-script.patch > @@ -0,0 +1,127 @@ > +From: Christian Melki <[email protected]> > +Date: Tue, 11 Jun 2024 18:23:54 +0200 > +Subject: [PATCH] revert rules: minor improvement to generation script > + > +Revert 809b7ad3003863476eb76a16e27ff7d00519f199 > + > +This delta needs python 3.11 but adds nothing in term > +of functionality. > + > +Signed-off-by: Christian Melki <[email protected]> > +--- > + rules/generate-options-symbols.py | 30 ++++++++++++++---------------- > + 1 file changed, 14 insertions(+), 16 deletions(-) > + > +diff --git a/rules/generate-options-symbols.py > b/rules/generate-options-symbols.py > +index b29b9253fe1f..1ac3be2cff29 100755 > +--- a/rules/generate-options-symbols.py > ++++ b/rules/generate-options-symbols.py > +@@ -7,7 +7,7 @@ > + > + from __future__ import annotations > + import argparse > +-from enum import StrEnum, unique > ++from enum import Enum, unique > + import sys > + import xml.etree.ElementTree as ET > + > +@@ -23,7 +23,7 @@ def error(msg): > + > + > + @unique > +-class Section(StrEnum): > ++class Section(Enum): > + """ > + XKB sections. > + Name correspond to the header (`xkb_XXX`), value to the subdir/rules > header. > +@@ -37,9 +37,6 @@ class Section(StrEnum): > + > + @classmethod > + def parse(cls, raw: str) -> Section: > +- # Note: in order to display a nice message, argparse requires the > error > +- # to be one of: ArgumentTypeError, TypeError, or ValueError > +- # See: https://docs.python.org/3/library/argparse.html#type > + try: > + return cls[raw] > + except KeyError: > +@@ -62,7 +59,7 @@ class Directive: > + > + @dataclass > + class DirectiveSet: > +- option: Option > ++ option: "Option" > + keycodes: Directive | None > + compatibility: Directive | None > + geometry: Directive | None > +@@ -108,7 +105,7 @@ def resolve_option(xkb_root: Path, option: Option) -> > DirectiveSet: > + directive = option.directive > + filename, section_name = directive.filename, directive.section > + for section in Section: > +- subdir = xkb_root / section > ++ subdir = xkb_root / section.value > + if not (subdir / filename).exists(): > + # Some of our foo:bar entries map to a baz_vndr/foo file > + for vndr in subdir.glob("*_vndr"): > +@@ -128,8 +125,8 @@ def resolve_option(xkb_root: Path, option: Option) -> > DirectiveSet: > + # Now check if the target file actually has that section > + f = subdir / resolved_filename > + with f.open("rt", encoding="utf-8") as fd: > +- section_header = f'xkb_{section.name} "{section_name}"' > +- if any(section_header in line for line in fd): > ++ found = any(f'xkb_{section.name} "{section_name}"' in line for > line in fd) > ++ if found: > + directives[section] = Directive(option, resolved_filename, > section_name) > + > + return DirectiveSet( > +@@ -142,7 +139,7 @@ def resolve_option(xkb_root: Path, option: Option) -> > DirectiveSet: > + ) > + > + > +-def options(rules_xml: Path) -> Iterable[Option]: > ++def options(rules_xml) -> Iterable[Option]: > + """ > + Yields all Options from the given XML file > + """ > +@@ -229,10 +226,9 @@ def main(): > + default=Section.symbols, > + ) > + parser.add_argument( > +- "files", nargs="+", help="The base.xml and base.extras.xml files", > type=Path > ++ "files", nargs="+", help="The base.xml and base.extras.xml files" > + ) > + ns = parser.parse_args() > +- rules_section: Section = ns.rules_section > + > + all_options = (opt for f in ns.files for opt in options(f)) > + > +@@ -244,24 +240,26 @@ def main(): > + if o.name not in skip and not o.name.startswith("custom:") > + ) > + > +- def check_and_map(directive: DirectiveSet) -> Directive: > ++ def check_and_map(directive: DirectiveSet): > + assert ( > + not directive.is_empty > + ), f"Option {directive.option} does not resolve to any section" > + > +- return getattr(directive, rules_section.name) > ++ return getattr(directive, ns.rules_section.name) > + > + filtered = filter( > + lambda y: y is not None, > + map(check_and_map, directives), > + ) > + > +- print(f"! option = {rules_section}") > ++ header = ns.rules_section.value > ++ > ++ print(f"! option = {header}") > + for d in filtered: > + assert d is not None > + print(f" {d.name:30s} = +{d}") > + > +- if rules_section is Section.types: > ++ if ns.rules_section is Section.types: > + print(f" {'custom:types':30s} = +custom") > + > + > diff --git a/patches/xkeyboard-config-2.42/series > b/patches/xkeyboard-config-2.42/series > new file mode 100644 > index 000000000000..e909ad068369 > --- /dev/null > +++ b/patches/xkeyboard-config-2.42/series > @@ -0,0 +1,4 @@ > +# generated by git-ptx-patches > +#tag:base --start-number 1 > +0001-revert-rules-minor-improvement-to-generation-script.patch > +# 2bf998cd0fca5a75f9109f7b885eb737 - git-ptx-patches magic > diff --git a/rules/xkeyboard-config.make b/rules/xkeyboard-config.make > index 50899f7153ff..19e732e2499f 100644 > --- a/rules/xkeyboard-config.make > +++ b/rules/xkeyboard-config.make > @@ -14,8 +14,8 @@ PACKAGES-$(PTXCONF_XKEYBOARD_CONFIG) += xkeyboard-config > # > # Paths and names > # > -XKEYBOARD_CONFIG_VERSION := 2.41 > -XKEYBOARD_CONFIG_MD5 := 2f0b843b5283b82cae0402cbc4f374b4 > +XKEYBOARD_CONFIG_VERSION := 2.42 > +XKEYBOARD_CONFIG_MD5 := 2d3b7e43e597f4c607ad6261e2b3d77f > XKEYBOARD_CONFIG := xkeyboard-config-$(XKEYBOARD_CONFIG_VERSION) > XKEYBOARD_CONFIG_SUFFIX := tar.xz > XKEYBOARD_CONFIG_URL := $(call ptx/mirror, XORG, > individual/data/xkeyboard-config/$(XKEYBOARD_CONFIG).$(XKEYBOARD_CONFIG_SUFFIX))
