File: list.sh

package info (click to toggle)
vlc 3.0.21-10
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 212,728 kB
  • sloc: ansic: 441,379; cpp: 110,628; objc: 36,394; sh: 6,947; makefile: 6,592; javascript: 4,902; xml: 1,611; asm: 1,355; yacc: 640; python: 555; lex: 88; perl: 77; sed: 16
file content (70 lines) | stat: -rwxr-xr-x 1,274 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
#! /bin/sh
# Piggy list consistency checker

LANG=C
export LANG

TEMPFILE=/tmp/vlclist.tmp.$$
LISTFILE=MODULES_LIST


rm -f $TEMPFILE
touch $TEMPFILE

echo "------------------------------------"
echo "Checking that all modules are listed"
echo "------------------------------------"

i=0

for modfile in `find . -name "Makefile.am"`
do
 for module in `awk '/^lib.*_plugin_la_SOURCES/{sub(/lib/,""); sub(/_plugin_la_SOURCES/,"",$1); print $1}' "$modfile"`
 do
  echo $module >> $TEMPFILE
  if ! grep -q " \* $module:" $LISTFILE
  then
   echo "$module exists in $modfile, but not listed"
   i=1
  fi
 done
done

if [ $i = 0 ]
then
  echo "OK"
fi

i=0

echo
echo "--------------------------------------"
echo "Checking that all listed modules exist"
echo "--------------------------------------"

for module in `awk -F'[ :]' '/ \* /{print $3}' $LISTFILE`
do
 if ! grep -wq $module $TEMPFILE
 then
  i=1
  echo "$module is listed but does not exist"
 fi
done

if [ $i = 0 ]
then
  echo "OK"
fi

echo
echo "-------------------------------"
echo "Checking for alphabetical order"
echo "-------------------------------"

grep " \* " $LISTFILE | LC_COLLATE=C LC_CTYPE=C sort -c && echo "OK"


echo ""
echo "`sort -u $TEMPFILE | wc -l` modules listed in Makefiles"

rm -f $TEMPFILE