]> git.sesse.net Git - vlc/blob - modules/list.sh
8e1384c36508620240b8b076b3ddfc090783120a
[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                `awk '/^lib.*_plugin_la_SOURCES/{sub(/lib/,""); sub(/_plugin_la_SOURCES/,"",$1); print $1}' "$modfile"`
24  do
25   echo $module >> $TEMPFILE
26   if ! grep -q " \* $module:" $LISTFILE
27   then
28    echo "$module exists in $modfile, but not listed"
29    i=1
30   fi
31  done
32 done
33
34 if [ $i = 0 ]
35 then
36   echo "OK"
37 fi
38
39 i=0
40
41 echo
42 echo "--------------------------------------"
43 echo "Checking that all listed modules exist"
44 echo "--------------------------------------"
45
46 for module in `awk -F'[ :]' '/ \* /{print $3}' $LISTFILE`
47 do
48  if ! grep -wq $module $TEMPFILE
49  then
50   i=1
51   echo "$module is listed but does not exist"
52  fi
53 done
54
55 if [ $i = 0 ]
56 then
57   echo "OK"
58 fi
59
60 echo
61 echo "-------------------------------"
62 echo "Checking for alphabetical order"
63 echo "-------------------------------"
64
65 grep " \* " $LISTFILE | LC_CTYPE=C sort -c && echo "OK"
66
67
68 echo ""
69 echo "`wc -l < $TEMPFILE` modules listed in Modules.am files"
70
71 rm -f $TEMPFILE