Commit 92b1b630 authored by Sam Hocevar's avatar Sam Hocevar

* modules/list.sh:

    + "==" is not valid shell test, use "=" instead.
    + Set LANG for consistency of sort output.
  (NB: this really belongs to the toolbox script).
parent c4c3e737
#! /bin/sh #! /bin/sh
# Piggy list consistency checker # Piggy list consistency checker
LANG=C
export LANG
TEMPFILE=/tmp/list.tmp TEMPFILE=/tmp/list.tmp
LISTFILE=LIST LISTFILE=LIST
LISTFILE2=/tmp/list2.tmp LISTFILE2=/tmp/list2.tmp
...@@ -21,7 +24,7 @@ do ...@@ -21,7 +24,7 @@ do
for module in `grep "SOURCES_" $modfile|awk '{print $1}'|awk 'BEGIN {FS="SOURCES_"};{print $2}'` for module in `grep "SOURCES_" $modfile|awk '{print $1}'|awk 'BEGIN {FS="SOURCES_"};{print $2}'`
do do
echo $module >> $TEMPFILE echo $module >> $TEMPFILE
if [ `grep " \* $module:" $LISTFILE |wc -l` == 0 ] if [ `grep " \* $module:" $LISTFILE |wc -l` = 0 ]
then then
echo "$module exists in $modfile, but not listed" echo "$module exists in $modfile, but not listed"
i=1 i=1
...@@ -29,7 +32,7 @@ do ...@@ -29,7 +32,7 @@ do
done done
done done
if [ $i == 0 ] if [ $i = 0 ]
then then
echo "OK" echo "OK"
fi fi
...@@ -43,14 +46,14 @@ echo "--------------------------------------" ...@@ -43,14 +46,14 @@ echo "--------------------------------------"
for module in `grep " \* " $LISTFILE|awk '{print $2}'|sed s,':',,g ` for module in `grep " \* " $LISTFILE|awk '{print $2}'|sed s,':',,g `
do do
if [`grep $module $TEMPFILE|wc -l` == 0 ] if [ `grep $module $TEMPFILE|wc -l` = 0 ]
then then
i=1 i=1
echo "$module is listed but does not exist" echo "$module is listed but does not exist"
fi fi
done done
if [ $i == 0 ] if [ $i = 0 ]
then then
echo "OK" echo "OK"
fi fi
...@@ -70,9 +73,9 @@ grep " \* " $LISTFILE >> $LISTFILE2 ...@@ -70,9 +73,9 @@ grep " \* " $LISTFILE >> $LISTFILE2
sort -n $LISTFILE2 >> $LISTFILE3 sort -n $LISTFILE2 >> $LISTFILE3
i=`diff $LISTFILE2 $LISTFILE3|wc -l` i=`diff $LISTFILE2 $LISTFILE3|wc -l`
diff $LISTFILE2 $LISTFILE3 diff -u $LISTFILE2 $LISTFILE3
if [ $i == 0 ] if [ $i = 0 ]
then then
echo "OK" echo "OK"
fi fi
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment