summaryrefslogtreecommitdiff
path: root/tests/verify-group-names.sh
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2023-06-29 09:39:32 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2023-07-06 09:11:50 +1000
commit592d968152c1d0a1ac824e3e45960a588d60db11 (patch)
tree7ed5c7963c0e81aa494395051e5931790a82e3a3 /tests/verify-group-names.sh
parentc8d76c4357b92cc291d82197bb99d3adff6494be (diff)
tests: xsltproc can take multiple files
We can supply both base.xml and base.extras.xml to xsltproc, getting rid of one temporary file and a name redirection. And in the process rename the files so it's more obvious to read. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Diffstat (limited to 'tests/verify-group-names.sh')
-rwxr-xr-xtests/verify-group-names.sh17
1 files changed, 7 insertions, 10 deletions
diff --git a/tests/verify-group-names.sh b/tests/verify-group-names.sh
index 34dc5af4..f464a702 100755
--- a/tests/verify-group-names.sh
+++ b/tests/verify-group-names.sh
@@ -14,21 +14,18 @@ ROOT=$(realpath "$scriptdir/..")
cd "$tmpdir" || exit 1
# temporary files
-registry_names=reg_names.lst
-group_names=grp_names.lst
-registry_names_base=${registry_names}.base
-registry_names_extras=${registry_names}.extras
+registry_names=registry_names.lst
+group_names=group_names.lst
# Convert base.xml and base.extras.xml to a list of `layout(variant):"blah blah"` lines
-xsltproc "$ROOT"/tests/reg2ll.xsl "$ROOT"/rules/base.xml > $registry_names_base
-xsltproc "$ROOT"/tests/reg2ll.xsl "$ROOT"/rules/base.extras.xml | grep -v sun_type > $registry_names_extras
+xsltproc "$ROOT"/tests/reg2ll.xsl "$ROOT"/rules/base.xml "$ROOT"/rules/base.extras.xml | grep -v sun_type > $registry_names
# Filter out empty lines and the custom layout
-cat $registry_names_base $registry_names_extras | \
+grep -v -e '^$' \
+ -e '^custom:' $registry_names | \
sort | \
- uniq | \
- grep -v -e '^$' \
- -e '^custom:' > $registry_names
+ uniq > $registry_names.tmp
+mv $registry_names.tmp $registry_names
# Now search each symbols file for xkb_symbols "variant" and the description of
# name[Group1]="blah blah" and print out a line `filename(variant):"blah blah"`.