preparing 0.5
[xorg/xkeyboard-config] / tests / genLists4Comparizon.sh
1 #!/bin/sh
2
3 ROOT="`dirname $0`/.."
4 F1=reg2ll.lst
5 F2=gn2ll.lst
6
7 xsltproc $ROOT/xslt/reg2ll.xsl $ROOT/rules/base.xml | sort | uniq > $F1
8
9 for i in $ROOT/symbols/*; do
10   if [ -f $i ]; then
11     id="`basename $i`"
12     gawk 'BEGIN{
13   FS="\""
14   isDefault=0;
15 }
16 /.*default.*/{
17   isDefault=1;
18 }
19 /xkb_symbols/{
20   variant=$2;
21 }/^[[:space:]]*name\[Group1\][[:space:]]*=/{
22   if (isDefault==1)
23   {
24     printf "___ %s\n",$2;
25     isDefault=0;
26   } else
27   {
28     printf "%s %s\n",variant,$2;
29   }
30 }' $i | while read var name; do
31       # read one variable!
32       if [ "${var}" == "___" ]; then
33         echo "${id}:\"${name}\""
34       else
35         echo "${id}(${var}):\"${name}\""
36       fi
37     done
38   fi
39 done | sort | uniq > $F2
40
41 diff $F1 $F2