From 4daba00d4780524d998e95faf93c74cb4e3a7d38 Mon Sep 17 00:00:00 2001 From: mrdudz Date: Wed, 18 Jun 2025 00:28:53 +0200 Subject: [PATCH] don't make script choke with more than 9 tables --- .github/checks/sorted.sh | 4 ++-- .github/checks/sorted_codeopt.sh | 4 ++-- .github/checks/sorted_opcodes.sh | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/checks/sorted.sh b/.github/checks/sorted.sh index 0a4a90db7..4f53b0484 100755 --- a/.github/checks/sorted.sh +++ b/.github/checks/sorted.sh @@ -13,8 +13,8 @@ function checkarray_quoted_name START="\\/\\* BEGIN SORTED.SH \\*\\/" END="\\/\\* END SORTED.SH \\*\\/" - awk '/'"$START"'/{flag=1; count++; next} /'"$END"'/{flag=0;} flag {print count,"##",$0}' "$CHECK_FILE" | \ - sed -e 's:\(.*\) ##.*\"\(.*\)\".*:\1##\2:g' > .a.tmp + awk '/'"$START"'/{flag=1; count++; next} /'"$END"'/{flag=0;} flag {printf("%04d##%s\n", count, $0)}' "$CHECK_FILE" | \ + sed -e 's:\(.*\)##.*\"\(.*\)\".*:\1##\2:g' > .a.tmp if [[ -z $(grep '[^[:space:]]' .a.tmp) ]] ; then echo "error: "$1" table is empty" diff --git a/.github/checks/sorted_codeopt.sh b/.github/checks/sorted_codeopt.sh index e90e32b4a..c78662b9d 100755 --- a/.github/checks/sorted_codeopt.sh +++ b/.github/checks/sorted_codeopt.sh @@ -13,7 +13,7 @@ function checkarray START="\\/\\* BEGIN DECL SORTED_CODEOPT.SH \\*\\/" END="\\/\\* END DECL SORTED_CODEOPT.SH \\*\\/" - awk '/'"$START"'/{flag=1; count++; next} /'"$END"'/{flag=0;} flag {print count,"##",$0}' "$CHECK_FILE" | \ + awk '/'"$START"'/{flag=1; count++; next} /'"$END"'/{flag=0;} flag {printf("%04d##%s\n", count, $0)}' "$CHECK_FILE" | \ sed -e 's:\(.*##\).*"\(.*\)",.*:\1\2:g' > .a.tmp if [[ -z $(grep '[^[:space:]]' .a.tmp) ]] ; then @@ -33,7 +33,7 @@ function checkarray START="\\/\\* BEGIN SORTED_CODEOPT.SH \\*\\/" END="\\/\\* END SORTED_CODEOPT.SH \\*\\/" - awk '/'"$START"'/{flag=1; count++; next} /'"$END"'/{flag=0;} flag {print count,"##",$0}' "$CHECK_FILE" | \ + awk '/'"$START"'/{flag=1; count++; next} /'"$END"'/{flag=0;} flag {printf("%04d##%s\n", count, $0)}' "$CHECK_FILE" | \ sed -e 's:\(.*##\).*&D\(.*\),.*:\1\2:g' > .b.tmp if [[ -z $(grep '[^[:space:]]' .b.tmp) ]] ; then diff --git a/.github/checks/sorted_opcodes.sh b/.github/checks/sorted_opcodes.sh index b18b841c8..3e45ea752 100755 --- a/.github/checks/sorted_opcodes.sh +++ b/.github/checks/sorted_opcodes.sh @@ -13,10 +13,10 @@ function checkarray_quoted_name START="\\/\\* BEGIN SORTED_OPCODES.SH \\*\\/" END="\\/\\* END SORTED_OPCODES.SH \\*\\/" - awk '/'"$START"'/{flag=1; count++; next} /'"$END"'/{flag=0;} flag {print count,"##",$0}' "$CHECK_FILE" | \ + awk '/'"$START"'/{flag=1; count++; next} /'"$END"'/{flag=0;} flag {printf("%04d##%s\n", count, $0)}' "$CHECK_FILE" | \ sed 's:/\*.*::g' | \ grep '".*",' | \ - sed -e 's:\(.*\) ##.*\"\(.*\)\".*:\1##\2:g' > .a.tmp + sed -e 's:\(.*\)##.*\"\(.*\)\".*:\1##\2:g' > .a.tmp if [[ -z $(grep '[^[:space:]]' .a.tmp) ]] ; then echo "error: "$1" table is empty"