]> git.sesse.net Git - vlc/blob - modules/list.sh
* modules/LIST: Updated all modules
[vlc] / modules / list.sh
1 #! /bin/sh
2 # Piggy list consistency checker
3
4 TEMPFILE=/tmp/list.tmp
5 LISTFILE=LIST
6 LISTFILE2=/tmp/list2.tmp
7 LISTFILE3=/tmp/list3.tmp
8
9
10 rm -f $TEMPFILE
11 touch $TEMPFILE
12
13 echo "------------------------------------"
14 echo "Checking that all modules are listed"
15 echo "------------------------------------"
16
17 i=0
18
19 for modfile in `find . -name "Modules.am"`
20 do
21  for module in `grep "SOURCES_" $modfile|awk '{print $1}'|awk 'BEGIN {FS="SOURCES_"};{print $2}'`
22  do
23   echo $module >> $TEMPFILE
24   if [ `grep " \* $module:" $LISTFILE |wc -l` == 0 ]
25   then
26    echo "$module exists in $modfile, but not listed"
27    i=1
28   fi
29  done
30 done
31
32 if [ $i == 0 ]
33 then
34   echo "OK"
35 fi
36
37 i=0
38
39 echo
40 echo "--------------------------------------"
41 echo "Checking that all listed modules exist"
42 echo "--------------------------------------"
43
44 for module in `grep " \* " $LISTFILE|awk '{print $2}'|sed s,':',,g `
45 do
46  if [`grep $module $TEMPFILE|wc -l` == 0 ]
47  then
48   i=1
49   echo "$module is listed but does not exist"
50  fi
51 done
52
53 if [ $i == 0 ]
54 then
55   echo "OK"
56 fi
57
58 echo
59 echo "-------------------------------"
60 echo "Checking for alphabetical order"
61 echo "-------------------------------"
62
63 rm -f $LISTFILE2
64 touch $LISTFILE2
65 rm -f $LISTFILE3
66 touch $LISTFILE3
67
68 grep " \* " $LISTFILE  >> $LISTFILE2
69
70 sort -n $LISTFILE2 >> $LISTFILE3
71
72 i=`diff $LISTFILE2 $LISTFILE3|wc -l`
73 diff $LISTFILE2 $LISTFILE3
74
75 if [ $i == 0 ]
76 then 
77   echo "OK"
78 fi
79
80
81 echo ""
82 echo "`cat $TEMPFILE| wc -l` modules listed in Modules.am files"
83
84 rm -f $TEMPFILE
85 rm -f $LISTFILE2
86 rm -f $LISTFILE3