minor improvements
authorthierry <thierry@41d37cc5-eb28-0410-a9bf-d37491348ade>
Mon, 21 Apr 2008 12:24:33 +0000 (12:24 +0000)
committerthierry <thierry@41d37cc5-eb28-0410-a9bf-d37491348ade>
Mon, 21 Apr 2008 12:24:33 +0000 (12:24 +0000)
scripts/svn-keywords.sh

index d5351bc..ee96bc0 100755 (executable)
@@ -63,14 +63,25 @@ function run_keywords () {
            cd $dir
            echo "xxxxxxxxxxxxxxxxxxxx Fixing keywords props in $(pwd)"
            echo -n "xxxxxxxxxx Gathering files under subversion "
-           svnfiles=$(svn list -R)
-           echo $(ls -1 $svnfiles | wc -l) files found
+           svnfiles=$(svn list -R | grep -v '/$')
            
+           # handle this, as otherwise grep hangs on stdin
+           if [ -z "$svnfiles" ] ; then
+               echo "xxxxx Nothing applicable in $dir - skipping"
+               continue
+           fi
+               
+           echo $(ls -1 $svnfiles | wc -l) files found
+
            for keyword in $keywords ; do
                
                files=$(grep -l '$'"$keyword" $svnfiles)
+               if [ -z "$files" ] ; then
+                   echo "xxxxx No file found with \$$keyword"
+                   continue
+               fi
                nbfiles=$(ls -1 $files | wc -l)
-               echo Found $nbfiles with \$$keyword
+               echo "xxxxx Found" $nbfiles "with \$$keyword"
            
                for file in $files ; do
                    run_keyword_on_file $keyword $file