From 17e104138e78cceb67128a3f8abd378133e993e8 Mon Sep 17 00:00:00 2001 From: Thomas Voss Date: Fri, 3 May 2024 01:48:50 +0200 Subject: Improve gen script runner --- gen/prop/bool-props | 20 +++++++++++++------- gen/prop/lib.py | 4 ++-- 2 files changed, 15 insertions(+), 9 deletions(-) diff --git a/gen/prop/bool-props b/gen/prop/bool-props index 198b0b8..a79f858 100755 --- a/gen/prop/bool-props +++ b/gen/prop/bool-props @@ -79,15 +79,21 @@ ri=Regional_Indicator gen() { local p=${1%%=*} - gen/prop/bool-props.py ${1#*=} $p data/$2 \ - >lib/unicode/prop/uprop_is_$p.c + printf 'sh -c "gen/prop/bool-props.py %s %s %s >%s"\n' \ + ${1#*=} $p data/$2 lib/unicode/prop/uprop_is_$p.c } -for prop in $props1; do gen $prop PropList & done -for prop in $props2; do gen $prop DerivedCoreProperties & done -for prop in $props3; do gen $prop emoji-data & done -for prop in $props4; do gen $prop DerivedNormalizationProps & done -for prop in $props5; do gen $prop DerivedBinaryProperties & done +( + IFS=' +' + parallel-moreutils -- $( + for prop in $props1; do gen $prop PropList & done + for prop in $props2; do gen $prop DerivedCoreProperties & done + for prop in $props3; do gen $prop emoji-data & done + for prop in $props4; do gen $prop DerivedNormalizationProps & done + for prop in $props5; do gen $prop DerivedBinaryProperties & done + ) +) printf '[[_mlib_pure]] bool uprop_is_%s(rune);\n' \ $(printf '%s\n' $props1 $props2 $props3 $props4 $props5 | cut -d= -f1) \ diff --git a/gen/prop/lib.py b/gen/prop/lib.py index cc0b00a..5f4f061 100644 --- a/gen/prop/lib.py +++ b/gen/prop/lib.py @@ -60,8 +60,8 @@ def report_size(before: int, after: int) -> None: s = s[:-2] return s + ' KiB' - prefix = sys.argv[0].split('/')[-1] + prefix = sys.argv[0].split('/')[-1].ljust(len('id_compat_math_continue') + 2) change = round((after - before) / before * 100, 1) before = btokib(before) after = btokib(after) - print(f'%s\t%s%%\t%s → %s' % (prefix, change, before, after), file=sys.stderr) + print(f'%s%s%%, %s → %s' % (prefix, change, before, after), file=sys.stderr) -- cgit v1.2.3