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