diff options
author | 2025-04-17 14:45:16 -0400 | |
---|---|---|
committer | 2025-04-26 11:22:04 +0200 | |
commit | c2d2c5c0d631f7de9697870e4eec89289177d445 (patch) | |
tree | 08e5ab964480b90f43a9fb7a8b6fec7e213e1dd4 /drivers/tty/vt/gen_ucs_recompose_table.py | |
parent | vt: refresh ucs_width_table.h and adjust code in ucs.c accordingly (diff) | |
download | wireguard-linux-c2d2c5c0d631f7de9697870e4eec89289177d445.tar.xz wireguard-linux-c2d2c5c0d631f7de9697870e4eec89289177d445.zip |
vt: move UCS tables to the "shipped" form
Use the "shipped" mechanism to copy pre-generated tables to the build
tree by default. If GENERATE_UCS_TABLES=1 then they are generated at
build time instead. If GENERATE_UCS_TABLES=2 then
gen_ucs_recompose_table.py is invoked with --full.
Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
Suggested-by: Jiri Slaby <jirislaby@kernel.org>
Link: https://lore.kernel.org/r/20250417184849.475581-15-nico@fluxnic.net
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/tty/vt/gen_ucs_recompose_table.py')
-rwxr-xr-x | drivers/tty/vt/gen_ucs_recompose_table.py | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/drivers/tty/vt/gen_ucs_recompose_table.py b/drivers/tty/vt/gen_ucs_recompose_table.py index d30f8f5242d2..4434a436ac9e 100755 --- a/drivers/tty/vt/gen_ucs_recompose_table.py +++ b/drivers/tty/vt/gen_ucs_recompose_table.py @@ -19,8 +19,8 @@ import textwrap from pathlib import Path this_file = Path(__file__).name -# Output file name -out_file = "ucs_recompose_table.h" +# Default output file name +DEFAULT_OUT_FILE = "ucs_recompose_table.h" common_recompose_description = "most commonly used Latin, Greek, and Cyrillic recomposition pairs only" COMMON_RECOMPOSITION_PAIRS = [ @@ -165,7 +165,7 @@ def validate_common_pairs(full_list): print(error_msg) raise ValueError(error_msg) -def generate_recomposition_table(use_full_list=False): +def generate_recomposition_table(use_full_list=False, out_file=DEFAULT_OUT_FILE): """Generate the recomposition C table.""" # Collect all recomposition pairs for validation @@ -250,6 +250,8 @@ if __name__ == "__main__": parser = argparse.ArgumentParser(description="Generate Unicode recomposition table") parser.add_argument("--full", action="store_true", help="Generate a full recomposition table (default: common pairs only)") + parser.add_argument("-o", "--output", dest="output_file", default=DEFAULT_OUT_FILE, + help=f"Output file name (default: {DEFAULT_OUT_FILE})") args = parser.parse_args() - generate_recomposition_table(use_full_list=args.full) + generate_recomposition_table(use_full_list=args.full, out_file=args.output_file) |