Skip to content

Commit

Permalink
Factorise list.sh a bit: rewrite some multiple commands as one where …
Browse files Browse the repository at this point in the history
…easy.
  • Loading branch information
JP Dinger committed Jul 31, 2009
1 parent d0e6240 commit ae13fdd
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions modules/list.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ 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"`
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
Expand All @@ -44,9 +44,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 '/ \* /{gsub(/:/,"",$2); print $2}' $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"
Expand Down

0 comments on commit ae13fdd

Please sign in to comment.