Remove extant reference to the `symbols/extras' directory
[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 F1b=${F1}base
13 F1e=${F1}extras
14
15 xsltproc $ROOT/xslt/reg2ll.xsl $ROOT/rules/base.xml > $F1b
16 xsltproc $ROOT/xslt/reg2ll.xsl $ROOT/rules/base.extras.xml > $F1e
17 cat $F1b $F1e | sort | uniq > $F1
18 rm -f $F1e $F1e
19
20 for i in $ROOT/symbols/*; do
21   if [ -f $i ]; then
22     id="`basename $i`"
23     export id
24     gawk 'BEGIN{
25   FS = "\"";
26   id = ENVIRON["id"];
27   isDefault = 0;
28 }
29 /.*default.*/{
30   isDefault = 1;
31 }
32 /xkb_symbols/{
33   variant = $2;
34 }/^[[:space:]]*name\[Group1\][[:space:]]*=/{
35   if (isDefault == 1)
36   {
37     printf "%s:\"%s\"\n",id,$2;
38     isDefault=0;
39   } else
40   {
41     name=$2;
42     if (variant == "olpc" || variant == "htcdream")
43       printf "%s:\"%s\"\n", id, name;
44     else
45       printf "%s(%s):\"%s\"\n", id, variant, name;
46   }
47 }' $i
48   fi
49 done | sort | uniq > $F2
50
51 diff $F1 $F2