Patchwork ptest-runner: compatibile with busybox

login
register
mail settings
Submitter rongqing.li@windriver.com
Date Sept. 23, 2013, 2:02 a.m.
Message ID <1379901723-887-1-git-send-email-rongqing.li@windriver.com>
Download mbox | patch
Permalink /patch/58501/
State New
Headers show

Comments

rongqing.li@windriver.com - Sept. 23, 2013, 2:02 a.m.
From: Roy Li <rongqing.li@windriver.com>

Do not use pushd, busybox does not support it if system only has busybox;
run-ptests are always installed under ${libdir}, not linked into ${libdir},
so do not need to find run-ptest under a link, that avoid to use -L option
when use find command

Signed-off-by: Roy Li <rongqing.li@windriver.com>
---
 meta/recipes-support/ptest-runner/files/ptest-runner |   16 ++--------------
 1 file changed, 2 insertions(+), 14 deletions(-)
Björn Stenberg - Sept. 23, 2013, 8:41 a.m.
rongqing.li@windriver.com wrote:
> +    for x in `find $libdir -name run-ptest -type f`
> +        cd `dirname "$x"`

You can get this list of ptest dirs by just running `ls -d */ptest`. It is simpler and also much faster than using "find".

Patch

diff --git a/meta/recipes-support/ptest-runner/files/ptest-runner b/meta/recipes-support/ptest-runner/files/ptest-runner
index ccb0434..3c89073 100644
--- a/meta/recipes-support/ptest-runner/files/ptest-runner
+++ b/meta/recipes-support/ptest-runner/files/ptest-runner
@@ -7,24 +7,12 @@  do
 
     [ ! -d "$libdir" ] && continue
 
-    cd "$libdir"
-    for x in `find -L ./ -name run-ptest -type f -perm /u+x,g+x`
+    for x in `find $libdir -name run-ptest -type f`
     do
-        # test if a dir is linking to one that they are under same directory
-        # like perl5-->perl
-        ptestdir=`dirname $x|cut -f2 -d"/"`
-        if [ -h "$ptestdir" ]; then
-            linkdir=`readlink -f "$ptestdir"`
-            if [ `dirname "$linkdir"` = "$libdir" ]; then
-                continue
-            fi
-        fi
-    
         date "+%Y-%m-%dT%H:%M"
         echo "BEGIN: $x"
-        pushd `dirname "$x"`
+        cd `dirname "$x"`
         ./run-ptest
-        popd
         echo "END: $x"
         date "+%Y-%m-%dT%H:%M"
     done