[vlc-devel] commit: Factorise list.sh a bit: rewrite some multiple commands as one where easy. (JP Dinger )

git version control git at videolan.org
Fri Jul 31 18:28:11 CEST 2009


vlc | branch: master | JP Dinger <jpd at videolan.org> | Mon Jul 27 15:54:53 2009 +0200| [ae13fdda72c140e318b6221f73223698cccbdcc1] | committer: JP Dinger 

Factorise list.sh a bit: rewrite some multiple commands as one where easy.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=ae13fdda72c140e318b6221f73223698cccbdcc1
---

 modules/list.sh |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/modules/list.sh b/modules/list.sh
index cfa1147..ab7e539 100755
--- a/modules/list.sh
+++ b/modules/list.sh
@@ -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
@@ -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"




More information about the vlc-devel mailing list