X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=scripts%2Fsvn-keywords.sh;h=caa4cb94026dab76fd388b90dd20d1767aa51fe6;hb=794baa4e0667d36a6bf1462ec7f4a3f2c99e65bc;hp=d5351bc19afb3d2dfc836162848edad5c23d4b01;hpb=0d3927593e403bd9dc677cd55c4d9a27fba713fe;p=infrastructure.git diff --git a/scripts/svn-keywords.sh b/scripts/svn-keywords.sh index d5351bc..caa4cb9 100755 --- a/scripts/svn-keywords.sh +++ b/scripts/svn-keywords.sh @@ -1,6 +1,4 @@ #!/bin/bash -# $Id$ -# $URL$ COMMAND=$(basename $0) @@ -63,14 +61,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