Patchwork test-dependencies.sh: avoid showing misleading error messages

login
register
mail settings
Submitter jackie huang
Date Dec. 30, 2013, 9:09 a.m.
Message ID <1388394556-28170-1-git-send-email-jackie.huang@windriver.com>
Download mbox | patch
Permalink /patch/63897/
State New
Headers show

Comments

jackie huang - Dec. 30, 2013, 9:09 a.m.
From: Jackie Huang <jackie.huang@windriver.com>

This avoids the following error messages when no dependency
issue detected:
find: `/build/r_cgp-dep_1225/p_x86_1225/bitbake_build/tmp/work/': No such file or directory
grep: test-dependencies/1388042399/3_min/failed/*: No such file or directory
ls: cannot access test-dependencies/1388042399/3_min/failed/*: No such file or directory

Signed-off-by: Jackie Huang <jackie.huang@windriver.com>
---
 scripts/test-dependencies.sh |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
Martin Jansa - Dec. 30, 2013, 10:10 a.m.
On Mon, Dec 30, 2013 at 05:09:16PM +0800, jackie.huang@windriver.com wrote:
> From: Jackie Huang <jackie.huang@windriver.com>
> 
> This avoids the following error messages when no dependency
> issue detected:
> find: `/build/r_cgp-dep_1225/p_x86_1225/bitbake_build/tmp/work/': No such file or directory
> grep: test-dependencies/1388042399/3_min/failed/*: No such file or directory
> ls: cannot access test-dependencies/1388042399/3_min/failed/*: No such file or directory

Acked-by: Martin Jansa <Martin.Jansa@gmail.com>

> 
> Signed-off-by: Jackie Huang <jackie.huang@windriver.com>
> ---
>  scripts/test-dependencies.sh |    6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/scripts/test-dependencies.sh b/scripts/test-dependencies.sh
> index e4cf4d3..ca7e687 100755
> --- a/scripts/test-dependencies.sh
> +++ b/scripts/test-dependencies.sh
> @@ -178,14 +178,14 @@ build_every_recipe() {
>    # This will be usefull to see which library is pulling new dependency
>    echo "Copying do_package logs to ${OUTPUTB}/do_package/"
>    mkdir ${OUTPUTB}/do_package
> -  find $tmpdir/work/ -name log.do_package | while read f; do
> +  find $tmpdir/work/ -name log.do_package 2>/dev/null| while read f; do
>      # pn is 3 levels back, but we don't know if there is just one log per pn (only one arch and version)
>      # dest=`echo $f | sed 's#^.*/\([^/]*\)/\([^/]*\)/\([^/]*\)/log.do_package#\1#g'`
>      dest=`echo $f | sed "s#$tmpdir/work/##g; s#/#_#g"`
>      cp $f ${OUTPUTB}/do_package/$dest
>    done
> -  grep "ERROR: Task.*failed" ${OUTPUTB}/failed/*
> -  ls -1 ${OUTPUTB}/failed/* >> ${OUTPUT_BASE}/failed.recipes
> +  grep "ERROR: Task.*failed" ${OUTPUTB}/failed/* 2>/dev/null
> +  ls -1 ${OUTPUTB}/failed/* >> ${OUTPUT_BASE}/failed.recipes 2>/dev/null
>  }
>  
>  compare_deps() {
> -- 
> 1.7.9.5
>

Patch

diff --git a/scripts/test-dependencies.sh b/scripts/test-dependencies.sh
index e4cf4d3..ca7e687 100755
--- a/scripts/test-dependencies.sh
+++ b/scripts/test-dependencies.sh
@@ -178,14 +178,14 @@  build_every_recipe() {
   # This will be usefull to see which library is pulling new dependency
   echo "Copying do_package logs to ${OUTPUTB}/do_package/"
   mkdir ${OUTPUTB}/do_package
-  find $tmpdir/work/ -name log.do_package | while read f; do
+  find $tmpdir/work/ -name log.do_package 2>/dev/null| while read f; do
     # pn is 3 levels back, but we don't know if there is just one log per pn (only one arch and version)
     # dest=`echo $f | sed 's#^.*/\([^/]*\)/\([^/]*\)/\([^/]*\)/log.do_package#\1#g'`
     dest=`echo $f | sed "s#$tmpdir/work/##g; s#/#_#g"`
     cp $f ${OUTPUTB}/do_package/$dest
   done
-  grep "ERROR: Task.*failed" ${OUTPUTB}/failed/*
-  ls -1 ${OUTPUTB}/failed/* >> ${OUTPUT_BASE}/failed.recipes
+  grep "ERROR: Task.*failed" ${OUTPUTB}/failed/* 2>/dev/null
+  ls -1 ${OUTPUTB}/failed/* >> ${OUTPUT_BASE}/failed.recipes 2>/dev/null
 }
 
 compare_deps() {