diff options
Diffstat (limited to 'keymap/check-keymaps.sh')
-rwxr-xr-x | keymap/check-keymaps.sh | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/keymap/check-keymaps.sh b/keymap/check-keymaps.sh index bb38378..dc46f59 100755 --- a/keymap/check-keymaps.sh +++ b/keymap/check-keymaps.sh @@ -1,7 +1,8 @@ #!/bin/bash -# check that all key names in keymaps/* are known in <linux/input.h> -KEYLIST=${srcdir:-.}/keys.txt +# check that all key names in keymaps/* are known in <linux/input.h> +KEYLIST=./keys.txt +RULES=95-keymap.rules [ -e "$KEYLIST" ] || { echo "need $KEYLIST please build first" >&2 @@ -14,3 +15,16 @@ missing=$(join -v 2 <(awk '{print tolower(substr($1,5))}' $KEYLIST | sort -u) <( echo "$missing" >&2 exit 1 } + +# check that all maps referred to in $RULES exist +maps=$(sed -rn '/keymap \$name/ { s/^.*\$name ([^"]+).*$/\1/; p }' $RULES) +for m in $maps; do + [ -e keymaps/$m ] || { + echo "ERROR: unknown map name in $RULES: $m" >&2 + exit 1 + } + grep -q "keymaps/$m\>" Makefile.am || { + echo "ERROR: map file $m is not added to Makefile.am" >&2 + exit 1 + } +done |