diff options
author | Martin Pitt <martin.pitt@ubuntu.com> | 2009-05-11 19:09:01 +0200 |
---|---|---|
committer | Martin Pitt <martin.pitt@ubuntu.com> | 2009-05-11 19:09:01 +0200 |
commit | 8078f67f1ac488bd7fa979768ce003ceeb0773f4 (patch) | |
tree | a84496b31f88119e82647162020976ef7bd7b28d | |
parent | 27f51fdcc4e6882b0ce53f54740dc913a4c77464 (diff) |
keymap: check maps existance in check-keymaps.sh
Verify that maps referred to in the rules files actually exist in keymaps/.
-rwxr-xr-x | keymap/check-keymaps.sh | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/keymap/check-keymaps.sh b/keymap/check-keymaps.sh index e1e15cc..8d064df 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> +# 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,12 @@ 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 + } +done |