* : svn:keywords
[vlc.git] / modules / list.sh
blobcfa1147051cbb74747b03dafef9075191f73f76e
1 #! /bin/sh
2 # Piggy list consistency checker
4 LANG=C
5 export LANG
7 TEMPFILE=/tmp/vlclist.tmp.$$
8 LISTFILE=LIST
9 LISTFILE2=/tmp/vlclist2.tmp.$$
10 LISTFILE3=/tmp/vlclist3.tmp.$$
13 rm -f $TEMPFILE
14 touch $TEMPFILE
16 echo "------------------------------------"
17 echo "Checking that all modules are listed"
18 echo "------------------------------------"
20 i=0
22 for modfile in `find . -name "Modules.am"`
24 for module in `grep "SOURCES_" $modfile|awk '{print $1}'|awk 'BEGIN {FS="SOURCES_"};{print $2}'`
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
32 done
33 done
35 if [ $i = 0 ]
36 then
37 echo "OK"
40 i=0
42 echo
43 echo "--------------------------------------"
44 echo "Checking that all listed modules exist"
45 echo "--------------------------------------"
47 for module in `grep " \* " $LISTFILE|awk '{print $2}'|sed s,':',,g `
49 if [ `grep $module $TEMPFILE|wc -l` = 0 ]
50 then
51 i=1
52 echo "$module is listed but does not exist"
54 done
56 if [ $i = 0 ]
57 then
58 echo "OK"
61 echo
62 echo "-------------------------------"
63 echo "Checking for alphabetical order"
64 echo "-------------------------------"
66 rm -f $LISTFILE2
67 touch $LISTFILE2
68 rm -f $LISTFILE3
69 touch $LISTFILE3
71 grep " \* " $LISTFILE >> $LISTFILE2
73 sort -n $LISTFILE2 >> $LISTFILE3
75 i=`diff $LISTFILE2 $LISTFILE3|wc -l`
76 diff -u $LISTFILE2 $LISTFILE3
78 if [ $i = 0 ]
79 then
80 echo "OK"
84 echo ""
85 echo "`cat $TEMPFILE| wc -l` modules listed in Modules.am files"
87 rm -f $TEMPFILE
88 rm -f $LISTFILE2
89 rm -f $LISTFILE3