just some comments
[xorg/xkeyboard-config] / tests / genLists4Comparizon.sh
1 #!/bin/sh
2
3 #
4 # This script compares the group names which "have to be", according to the descriptions in base.xml -
5 # and actually existing in the symbol files. Some differences are ok (like extra double quotes or 
6 # extra escaping character) - but all the rest should be in sync.
7 #
8
9 ROOT="`dirname $0`/.."
10 F1=reg2ll.lst
11 F2=gn2ll.lst
12
13 xsltproc $ROOT/xslt/reg2ll.xsl $ROOT/rules/base.xml | sort | uniq > $F1
14
15 for i in $ROOT/symbols/*; do
16   if [ -f $i ]; then
17     id="`basename $i`"
18     gawk 'BEGIN{
19   FS="\""
20   isDefault=0;
21 }
22 /.*default.*/{
23   isDefault=1;
24 }
25 /xkb_symbols/{
26   variant=$2;
27 }/^[[:space:]]*name\[Group1\][[:space:]]*=/{
28   if (isDefault==1)
29   {
30     printf "___ %s\n",$2;
31     isDefault=0;
32   } else
33   {
34     printf "%s %s\n",variant,$2;
35   }
36 }' $i | while read var name; do
37       # read one variable!
38       if [ "${var}" == "___" ]; then
39         echo "${id}:\"${name}\""
40       else
41         echo "${id}(${var}):\"${name}\""
42       fi
43     done
44   fi
45 done | sort | uniq > $F2
46
47 diff $F1 $F2