]> git.sesse.net Git - vlc/blob - modules/list.sh
Simplify the other part, too.
[vlc] / modules / list.sh
1 #! /bin/sh
2 # Piggy list consistency checker
3
4 LANG=C
5 export LANG
6
7 TEMPFILE=/tmp/vlclist.tmp.$$
8 LISTFILE=LIST
9
10
11 rm -f $TEMPFILE
12 touch $TEMPFILE
13
14 echo "------------------------------------"
15 echo "Checking that all modules are listed"
16 echo "------------------------------------"
17
18 i=0
19
20 for modfile in `find . -name "Modules.am"`
21 do
22  for module in `awk '/^SOURCES_/{sub(/SOURCES_/,"",$1); print $1}' "$modfile"`
23  do
24   echo $module >> $TEMPFILE
25   if ! grep -q " \* $module:" $LISTFILE
26   then
27    echo "$module exists in $modfile, but not listed"
28    i=1
29   fi
30  done
31 done
32
33 if [ $i = 0 ]
34 then
35   echo "OK"
36 fi
37
38 i=0
39
40 echo
41 echo "--------------------------------------"
42 echo "Checking that all listed modules exist"
43 echo "--------------------------------------"
44
45 for module in `awk -F'[ :]' '/ \* /{print $3}' $LISTFILE`
46 do
47  if ! grep -q $module $TEMPFILE
48  then
49   i=1
50   echo "$module is listed but does not exist"
51  fi
52 done
53
54 if [ $i = 0 ]
55 then
56   echo "OK"
57 fi
58
59 echo
60 echo "-------------------------------"
61 echo "Checking for alphabetical order"
62 echo "-------------------------------"
63
64 grep " \* " $LISTFILE | LC_CTYPE=C sort -c && echo "OK"
65
66
67 echo ""
68 echo "`cat $TEMPFILE| wc -l` modules listed in Modules.am files"
69
70 rm -f $TEMPFILE