2003-08-10 20:45:52 +08:00
|
|
|
#! /bin/sh
|
|
|
|
# Piggy list consistency checker
|
|
|
|
|
2003-09-20 11:38:52 +08:00
|
|
|
LANG=C
|
|
|
|
export LANG
|
|
|
|
|
2005-08-14 02:44:31 +08:00
|
|
|
TEMPFILE=/tmp/vlclist.tmp.$$
|
2013-09-22 02:01:42 +08:00
|
|
|
LISTFILE=MODULES_LIST
|
2003-08-10 20:45:52 +08:00
|
|
|
|
|
|
|
|
|
|
|
rm -f $TEMPFILE
|
|
|
|
touch $TEMPFILE
|
|
|
|
|
|
|
|
echo "------------------------------------"
|
|
|
|
echo "Checking that all modules are listed"
|
|
|
|
echo "------------------------------------"
|
|
|
|
|
|
|
|
i=0
|
|
|
|
|
2013-09-22 05:28:53 +08:00
|
|
|
for modfile in `find . -name "Modules.am" -o -name "Makefile.am"`
|
2003-08-10 20:45:52 +08:00
|
|
|
do
|
2009-12-29 02:00:14 +08:00
|
|
|
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"`
|
2003-08-10 20:45:52 +08:00
|
|
|
do
|
|
|
|
echo $module >> $TEMPFILE
|
2009-07-27 21:54:53 +08:00
|
|
|
if ! grep -q " \* $module:" $LISTFILE
|
2003-08-10 20:45:52 +08:00
|
|
|
then
|
|
|
|
echo "$module exists in $modfile, but not listed"
|
|
|
|
i=1
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
done
|
|
|
|
|
2003-09-20 11:38:52 +08:00
|
|
|
if [ $i = 0 ]
|
2003-08-10 20:45:52 +08:00
|
|
|
then
|
|
|
|
echo "OK"
|
|
|
|
fi
|
|
|
|
|
|
|
|
i=0
|
|
|
|
|
|
|
|
echo
|
|
|
|
echo "--------------------------------------"
|
|
|
|
echo "Checking that all listed modules exist"
|
|
|
|
echo "--------------------------------------"
|
|
|
|
|
2009-07-28 22:04:47 +08:00
|
|
|
for module in `awk -F'[ :]' '/ \* /{print $3}' $LISTFILE`
|
2003-08-10 20:45:52 +08:00
|
|
|
do
|
2010-09-05 03:16:30 +08:00
|
|
|
if ! grep -wq $module $TEMPFILE
|
2003-08-10 20:45:52 +08:00
|
|
|
then
|
|
|
|
i=1
|
|
|
|
echo "$module is listed but does not exist"
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
|
2003-09-20 11:38:52 +08:00
|
|
|
if [ $i = 0 ]
|
2003-08-10 20:45:52 +08:00
|
|
|
then
|
|
|
|
echo "OK"
|
|
|
|
fi
|
|
|
|
|
|
|
|
echo
|
|
|
|
echo "-------------------------------"
|
|
|
|
echo "Checking for alphabetical order"
|
|
|
|
echo "-------------------------------"
|
|
|
|
|
2009-07-28 22:04:47 +08:00
|
|
|
grep " \* " $LISTFILE | LC_CTYPE=C sort -c && echo "OK"
|
2003-08-10 20:45:52 +08:00
|
|
|
|
|
|
|
|
|
|
|
echo ""
|
2010-09-08 04:53:40 +08:00
|
|
|
echo "`sort -u $TEMPFILE | wc -l` modules listed in Modules.am files"
|
2003-08-10 20:45:52 +08:00
|
|
|
|
|
|
|
rm -f $TEMPFILE
|