summaryrefslogtreecommitdiff
path: root/src/keymap/check-keymaps.sh
diff options
context:
space:
mode:
Diffstat (limited to 'src/keymap/check-keymaps.sh')
-rwxr-xr-xsrc/keymap/check-keymaps.sh15
1 files changed, 9 insertions, 6 deletions
diff --git a/src/keymap/check-keymaps.sh b/src/keymap/check-keymaps.sh
index c4572745e0..e3abe672d1 100755
--- a/src/keymap/check-keymaps.sh
+++ b/src/keymap/check-keymaps.sh
@@ -3,18 +3,21 @@
# check that all key names in keymaps/* are known in <linux/input.h>
# and that all key maps listed in the rules are valid and present in
# Makefile.am
-SRCDIR=${1:-.}
-KEYLIST=${2:-src/udev/keymap/keys.txt}
-KEYMAPS_DIR=$SRCDIR/keymaps
-RULES=$SRCDIR/src/udev/keymap/95-keymap.rules
+
+SRCDIR=${1:-../..}
+KEYLIST=${2:-${SRCDIR}/src/keymap/keys.txt}
[ -e "$KEYLIST" ] || {
echo "need $KEYLIST please build first" >&2
exit 1
}
+KEYMAPS_DIR=${SRCDIR}/keymaps
+KEYMAPS_LIST=$(ls ${KEYMAPS_DIR}/* | grep -v Makefile)
+RULES=${SRCDIR}/rules/95-keymap.rules
+
missing=$(join -v 2 <(awk '{print tolower(substr($1,5))}' $KEYLIST | sort -u) \
- <(grep -hv '^#' ${KEYMAPS_DIR}/*| awk '{print $2}' | sort -u))
+ <(grep -hv '^#' ${KEYMAPS_LIST}| awk '{print $2}' | sort -u))
[ -z "$missing" ] || {
echo "ERROR: unknown key names in keymaps/*:" >&2
echo "$missing" >&2
@@ -31,7 +34,7 @@ for m in $maps; do
echo "ERROR: unknown map name in $RULES: $m" >&2
exit 1
}
- grep -q "keymaps/$m\>" $SRCDIR/Makefile.am || {
+ grep -q "$m\>" ${SRCDIR}/keymaps/Makefile.am || {
echo "ERROR: map file $m is not added to Makefile.am" >&2
exit 1
}