aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Voss <mail@thomasvoss.com> 2024-05-03 01:48:50 +0200
committerThomas Voss <mail@thomasvoss.com> 2024-05-03 01:48:50 +0200
commit17e104138e78cceb67128a3f8abd378133e993e8 (patch)
treed9d4b4f81dfc7c3752180baa1dd84d3d52d3922c
parentd3cc478c3ebcfc65d89ddad7446e9652b50ab0df (diff)
Improve gen script runner
-rwxr-xr-xgen/prop/bool-props20
-rw-r--r--gen/prop/lib.py4
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)