X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=modules%2Flist.sh;h=7b02c51f6a89b114e160e38f986103e3aabbb776;hb=c12e97cbe7f2b58bd5d4f5c4c45485d59de6f315;hp=39feab346b7b4f85a288c304f140142e4da546e4;hpb=92b1b630f65ead2270fa4557d94f6e326def03ec;p=vlc diff --git a/modules/list.sh b/modules/list.sh index 39feab346b..7b02c51f6a 100755 --- a/modules/list.sh +++ b/modules/list.sh @@ -4,10 +4,8 @@ LANG=C export LANG -TEMPFILE=/tmp/list.tmp +TEMPFILE=/tmp/vlclist.tmp.$$ LISTFILE=LIST -LISTFILE2=/tmp/list2.tmp -LISTFILE3=/tmp/list3.tmp rm -f $TEMPFILE @@ -21,10 +19,11 @@ i=0 for modfile in `find . -name "Modules.am"` do - for module in `grep "SOURCES_" $modfile|awk '{print $1}'|awk 'BEGIN {FS="SOURCES_"};{print $2}'` + for module in `awk '/^SOURCES_/{sub(/SOURCES_/,"",$1); print $1}' "$modfile"`\ + `awk '/^lib.*_plugin_la_SOURCES/{sub(/lib/,""); sub(/_plugin_la_SOURCES/,"",$1); print $1}' "$modfile"` do echo $module >> $TEMPFILE - if [ `grep " \* $module:" $LISTFILE |wc -l` = 0 ] + if ! grep -q " \* $module:" $LISTFILE then echo "$module exists in $modfile, but not listed" i=1 @@ -44,9 +43,9 @@ echo "--------------------------------------" echo "Checking that all listed modules exist" echo "--------------------------------------" -for module in `grep " \* " $LISTFILE|awk '{print $2}'|sed s,':',,g ` +for module in `awk -F'[ :]' '/ \* /{print $3}' $LISTFILE` do - if [ `grep $module $TEMPFILE|wc -l` = 0 ] + if ! grep -q $module $TEMPFILE then i=1 echo "$module is listed but does not exist" @@ -63,27 +62,10 @@ echo "-------------------------------" echo "Checking for alphabetical order" echo "-------------------------------" -rm -f $LISTFILE2 -touch $LISTFILE2 -rm -f $LISTFILE3 -touch $LISTFILE3 - -grep " \* " $LISTFILE >> $LISTFILE2 - -sort -n $LISTFILE2 >> $LISTFILE3 - -i=`diff $LISTFILE2 $LISTFILE3|wc -l` -diff -u $LISTFILE2 $LISTFILE3 - -if [ $i = 0 ] -then - echo "OK" -fi +grep " \* " $LISTFILE | LC_CTYPE=C sort -c && echo "OK" echo "" echo "`cat $TEMPFILE| wc -l` modules listed in Modules.am files" rm -f $TEMPFILE -rm -f $LISTFILE2 -rm -f $LISTFILE3