All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/1 v2] ptest-runner: trivial fixes and refine
@ 2013-09-11  9:17 rongqing.li
  2013-09-11  9:17 ` [PATCH 1/1] " rongqing.li
  0 siblings, 1 reply; 10+ messages in thread
From: rongqing.li @ 2013-09-11  9:17 UTC (permalink / raw)
  To: openembedded-core

From: Roy Li <rongqing.li@windriver.com>

The following changes since commit 5b451a46550ba62e2fbfe5dbe50723b34a4fd527:

  systemd.bbclass: get the correct /lib directory (2013-09-10 23:15:09 +0100)

are available in the git repository at:

  git://git.pokylinux.org/poky-contrib roy/ptest-1
  http://git.pokylinux.org/cgit.cgi/poky-contrib/log/?h=roy/ptest-1

Roy Li (1):
  ptest-runner: trivial fixes and refine

 .../ptest-runner/files/ptest-runner                |   30 +++++++++++++++-----
 1 file changed, 23 insertions(+), 7 deletions(-)

-- 
1.7.10.4



^ permalink raw reply	[flat|nested] 10+ messages in thread

* [PATCH 1/1] ptest-runner: trivial fixes and refine
  2013-09-11  9:17 [PATCH 0/1 v2] ptest-runner: trivial fixes and refine rongqing.li
@ 2013-09-11  9:17 ` rongqing.li
  2013-09-12 20:45   ` Chris Larson
  0 siblings, 1 reply; 10+ messages in thread
From: rongqing.li @ 2013-09-11  9:17 UTC (permalink / raw)
  To: openembedded-core

From: Roy Li <rongqing.li@windriver.com>

1. ptest files may be installed under /usr/lib64/ for 64bit filesystem
or under /usr/lib/ for 64bit multilib filesystem, so we should check both
directories

2. If a soft link is linking to a directory under the same directory, we
only run once.

[YOCTO #5125]
[YOCTO #5126]

Signed-off-by: Roy Li <rongqing.li@windriver.com>
---
 .../ptest-runner/files/ptest-runner                |   30 +++++++++++++++-----
 1 file changed, 23 insertions(+), 7 deletions(-)

diff --git a/meta/recipes-support/ptest-runner/files/ptest-runner b/meta/recipes-support/ptest-runner/files/ptest-runner
index 4f3c7ce..ccb0434 100644
--- a/meta/recipes-support/ptest-runner/files/ptest-runner
+++ b/meta/recipes-support/ptest-runner/files/ptest-runner
@@ -1,16 +1,32 @@
 #!/bin/sh
 
 echo "START: $0"
-cd /usr/lib
-for x in *
+
+for libdir in /usr/lib*
 do
-    if [ -x "/usr/lib/$x/ptest/run-ptest" ]; then
-       date "+%Y-%m-%dT%H:%M"
+
+    [ ! -d "$libdir" ] && continue
+
+    cd "$libdir"
+    for x in `find -L ./ -name run-ptest -type f -perm /u+x,g+x`
+    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"
-        cd /usr/lib/$x/ptest
+        pushd `dirname "$x"`
         ./run-ptest
+        popd
         echo "END: $x"
-       date "+%Y-%m-%dT%H:%M"
-    fi
+        date "+%Y-%m-%dT%H:%M"
+    done
 done
 echo "STOP: $0"
-- 
1.7.10.4



^ permalink raw reply related	[flat|nested] 10+ messages in thread

* Re: [PATCH 1/1] ptest-runner: trivial fixes and refine
  2013-09-11  9:17 ` [PATCH 1/1] " rongqing.li
@ 2013-09-12 20:45   ` Chris Larson
  2013-09-17 13:35     ` Björn Stenberg
  2013-09-19 11:47     ` Björn Stenberg
  0 siblings, 2 replies; 10+ messages in thread
From: Chris Larson @ 2013-09-12 20:45 UTC (permalink / raw)
  To: rongqing.li; +Cc: Patches and discussions about the oe-core layer

[-- Attachment #1: Type: text/plain, Size: 302 bytes --]

On Wed, Sep 11, 2013 at 2:17 AM, <rongqing.li@windriver.com> wrote:

> +    for x in `find -L ./ -name run-ptest -type f -perm /u+x,g+x`
> +    do
>

As far as I can tell, busybox find doesn't support -L, so this adds an
implicit, undeclared dependency upon findutils.
-- 
Christopher Larson

[-- Attachment #2: Type: text/html, Size: 627 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH 1/1] ptest-runner: trivial fixes and refine
  2013-09-12 20:45   ` Chris Larson
@ 2013-09-17 13:35     ` Björn Stenberg
  2013-09-19 11:47     ` Björn Stenberg
  1 sibling, 0 replies; 10+ messages in thread
From: Björn Stenberg @ 2013-09-17 13:35 UTC (permalink / raw)
  To: Chris Larson; +Cc: Patches and discussions about the oe-core layer

Chris Larson wrote:
> On Wed, Sep 11, 2013 at 2:17 AM, <rongqing.li@windriver.com> wrote:
> 
> > +    for x in `find -L ./ -name run-ptest -type f -perm /u+x,g+x`
> > +    do
> >
> 
> As far as I can tell, busybox find doesn't support -L, so this adds an
> implicit, undeclared dependency upon findutils.

That is correct. Busybox find does however support -follow, which in turn GNU find does not...

-- 
Björn


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH 1/1] ptest-runner: trivial fixes and refine
  2013-09-12 20:45   ` Chris Larson
  2013-09-17 13:35     ` Björn Stenberg
@ 2013-09-19 11:47     ` Björn Stenberg
  2013-09-19 15:04       ` Randy MacLeod
  1 sibling, 1 reply; 10+ messages in thread
From: Björn Stenberg @ 2013-09-19 11:47 UTC (permalink / raw)
  To: rongqing.li; +Cc: openembedded-core

Chris Larson wrote:
> On Wed, Sep 11, 2013 at 2:17 AM, <rongqing.li@windriver.com> wrote:
> 
> > +    for x in `find -L ./ -name run-ptest -type f -perm /u+x,g+x`
> > +    do
> >
> 
> As far as I can tell, busybox find doesn't support -L, so this adds an
> implicit, undeclared dependency upon findutils.

Rongquing, are you planning on fixing this? As committed, ptest-runner can't run on busybox systems (which I'd argue are the majority of embedded systems).

-- 
Björn


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH 1/1] ptest-runner: trivial fixes and refine
  2013-09-19 11:47     ` Björn Stenberg
@ 2013-09-19 15:04       ` Randy MacLeod
  2013-09-20  9:17         ` Björn Stenberg
  0 siblings, 1 reply; 10+ messages in thread
From: Randy MacLeod @ 2013-09-19 15:04 UTC (permalink / raw)
  To: openembedded-core

On 13-09-19 07:47 AM, Björn Stenberg wrote:
> Chris Larson wrote:
>> On Wed, Sep 11, 2013 at 2:17 AM, <rongqing.li@windriver.com> wrote:
>>
>>> +    for x in `find -L ./ -name run-ptest -type f -perm /u+x,g+x`
>>> +    do
>>>
>>
>> As far as I can tell, busybox find doesn't support -L, so this adds an
>> implicit, undeclared dependency upon findutils.
>
> Rongqing, are you planning on fixing this? As committed, ptest-runner can't run on busybox systems
>

Yes, Roy will fix this. He's on holiday for a few days.

I presume he'll add a check to see which arg to use for find
rather than add a dependency on findutils.

 > (which I'd argue are the majority of embedded systems).

That's becoming less true over time, IMO.
It seems that more and more embedded linux users are on bigger
targets that use the discrete GNU tools.


-- 
# Randy MacLeod. SMTS, Linux, Wind River
Direct: 613.963.1350


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH 1/1] ptest-runner: trivial fixes and refine
  2013-09-19 15:04       ` Randy MacLeod
@ 2013-09-20  9:17         ` Björn Stenberg
  0 siblings, 0 replies; 10+ messages in thread
From: Björn Stenberg @ 2013-09-20  9:17 UTC (permalink / raw)
  To: Randy MacLeod; +Cc: openembedded-core

Randy MacLeod wrote:
> Yes, Roy will fix this. He's on holiday for a few days.

Excellent.

> I presume he'll add a check to see which arg to use for find
> rather than add a dependency on findutils.

I suggest skipping the find command altogether. The run-ptest files are defined to always sit in ${libdir}/${PN}/ptest and thus don't really need to be searched for.

Also, 'pushd' is not available in the busybox shell.

(I should have spotted these during patch review, but I was temporarily unavailable. Sorry about that.)

-- 
Björn


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH 1/1] ptest-runner: trivial fixes and refine
  2013-09-11  8:40   ` Richard Purdie
@ 2013-09-11  9:02     ` Rongqing Li
  0 siblings, 0 replies; 10+ messages in thread
From: Rongqing Li @ 2013-09-11  9:02 UTC (permalink / raw)
  To: Richard Purdie; +Cc: openembedded-core



On 09/11/2013 04:40 PM, Richard Purdie wrote:
> On Wed, 2013-09-11 at 15:34 +0800, rongqing.li@windriver.com wrote:
>> From: Roy Li <rongqing.li@windriver.com>
>>
>> 1. ptest files may be installed under /usr/lib64/ for 64bit filesystem
>> or under /usr/lib/ for 64bit multilib filesystem, so we should check both
>> directories
>>
>> 2. If a soft link is linking to a directory under the same directory, we
>> only run once.
>>
>> [YOCTO #5125]
>> [YOCTO #5126]
>>
>> Signed-off-by: Roy Li <rongqing.li@windriver.com>
>> ---
>>   .../ptest-runner/files/ptest-runner                |   30 +++++++++++++++-----
>>   1 file changed, 23 insertions(+), 7 deletions(-)
>>
>> diff --git a/meta/recipes-support/ptest-runner/files/ptest-runner b/meta/recipes-support/ptest-runner/files/ptest-runner
>> index 4f3c7ce..724e066 100644
>> --- a/meta/recipes-support/ptest-runner/files/ptest-runner
>> +++ b/meta/recipes-support/ptest-runner/files/ptest-runner
>> @@ -1,16 +1,32 @@
>>   #!/bin/sh
>>
>>   echo "START: $0"
>> -cd /usr/lib
>> -for x in *
>> +
>> +for libdir in /usr/lib/ /usr/lib64/
>
>
> We shouldn't hard code this. To keep things simple, I think you need to
> search /usr/lib*...
>
> Cheers,
>
> Richard

Thanks, I will change it

-Roy


>
>>   do
>> -    if [ -x "/usr/lib/$x/ptest/run-ptest" ]; then
>> -       date "+%Y-%m-%dT%H:%M"
>> +
>> +    [ ! -d "$libdir" ] && continue
>> +
>> +    cd "$libdir"
>> +    for x in `find -L ./ -name run-ptest -type f -perm /u+x,g+x`
>> +    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"
>> -        cd /usr/lib/$x/ptest
>> +        pushd `dirname "$x"`
>>           ./run-ptest
>> +        popd
>>           echo "END: $x"
>> -       date "+%Y-%m-%dT%H:%M"
>> -    fi
>> +        date "+%Y-%m-%dT%H:%M"
>> +    done
>>   done
>>   echo "STOP: $0"
>
>
>
>

-- 
Best Reagrds,
Roy | RongQing Li


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH 1/1] ptest-runner: trivial fixes and refine
  2013-09-11  7:34 ` [PATCH 1/1] " rongqing.li
@ 2013-09-11  8:40   ` Richard Purdie
  2013-09-11  9:02     ` Rongqing Li
  0 siblings, 1 reply; 10+ messages in thread
From: Richard Purdie @ 2013-09-11  8:40 UTC (permalink / raw)
  To: rongqing.li; +Cc: openembedded-core

On Wed, 2013-09-11 at 15:34 +0800, rongqing.li@windriver.com wrote:
> From: Roy Li <rongqing.li@windriver.com>
> 
> 1. ptest files may be installed under /usr/lib64/ for 64bit filesystem
> or under /usr/lib/ for 64bit multilib filesystem, so we should check both
> directories
> 
> 2. If a soft link is linking to a directory under the same directory, we
> only run once.
> 
> [YOCTO #5125]
> [YOCTO #5126]
> 
> Signed-off-by: Roy Li <rongqing.li@windriver.com>
> ---
>  .../ptest-runner/files/ptest-runner                |   30 +++++++++++++++-----
>  1 file changed, 23 insertions(+), 7 deletions(-)
> 
> diff --git a/meta/recipes-support/ptest-runner/files/ptest-runner b/meta/recipes-support/ptest-runner/files/ptest-runner
> index 4f3c7ce..724e066 100644
> --- a/meta/recipes-support/ptest-runner/files/ptest-runner
> +++ b/meta/recipes-support/ptest-runner/files/ptest-runner
> @@ -1,16 +1,32 @@
>  #!/bin/sh
>  
>  echo "START: $0"
> -cd /usr/lib
> -for x in *
> +
> +for libdir in /usr/lib/ /usr/lib64/


We shouldn't hard code this. To keep things simple, I think you need to
search /usr/lib*...

Cheers,

Richard

>  do
> -    if [ -x "/usr/lib/$x/ptest/run-ptest" ]; then
> -       date "+%Y-%m-%dT%H:%M"
> +
> +    [ ! -d "$libdir" ] && continue
> +
> +    cd "$libdir"
> +    for x in `find -L ./ -name run-ptest -type f -perm /u+x,g+x`
> +    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"
> -        cd /usr/lib/$x/ptest
> +        pushd `dirname "$x"`
>          ./run-ptest
> +        popd
>          echo "END: $x"
> -       date "+%Y-%m-%dT%H:%M"
> -    fi
> +        date "+%Y-%m-%dT%H:%M"
> +    done
>  done
>  echo "STOP: $0"




^ permalink raw reply	[flat|nested] 10+ messages in thread

* [PATCH 1/1] ptest-runner: trivial fixes and refine
  2013-09-11  7:34 [PATCH 0/1] " rongqing.li
@ 2013-09-11  7:34 ` rongqing.li
  2013-09-11  8:40   ` Richard Purdie
  0 siblings, 1 reply; 10+ messages in thread
From: rongqing.li @ 2013-09-11  7:34 UTC (permalink / raw)
  To: openembedded-core

From: Roy Li <rongqing.li@windriver.com>

1. ptest files may be installed under /usr/lib64/ for 64bit filesystem
or under /usr/lib/ for 64bit multilib filesystem, so we should check both
directories

2. If a soft link is linking to a directory under the same directory, we
only run once.

[YOCTO #5125]
[YOCTO #5126]

Signed-off-by: Roy Li <rongqing.li@windriver.com>
---
 .../ptest-runner/files/ptest-runner                |   30 +++++++++++++++-----
 1 file changed, 23 insertions(+), 7 deletions(-)

diff --git a/meta/recipes-support/ptest-runner/files/ptest-runner b/meta/recipes-support/ptest-runner/files/ptest-runner
index 4f3c7ce..724e066 100644
--- a/meta/recipes-support/ptest-runner/files/ptest-runner
+++ b/meta/recipes-support/ptest-runner/files/ptest-runner
@@ -1,16 +1,32 @@
 #!/bin/sh
 
 echo "START: $0"
-cd /usr/lib
-for x in *
+
+for libdir in /usr/lib/ /usr/lib64/
 do
-    if [ -x "/usr/lib/$x/ptest/run-ptest" ]; then
-       date "+%Y-%m-%dT%H:%M"
+
+    [ ! -d "$libdir" ] && continue
+
+    cd "$libdir"
+    for x in `find -L ./ -name run-ptest -type f -perm /u+x,g+x`
+    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"
-        cd /usr/lib/$x/ptest
+        pushd `dirname "$x"`
         ./run-ptest
+        popd
         echo "END: $x"
-       date "+%Y-%m-%dT%H:%M"
-    fi
+        date "+%Y-%m-%dT%H:%M"
+    done
 done
 echo "STOP: $0"
-- 
1.7.10.4



^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2013-09-20  9:17 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-09-11  9:17 [PATCH 0/1 v2] ptest-runner: trivial fixes and refine rongqing.li
2013-09-11  9:17 ` [PATCH 1/1] " rongqing.li
2013-09-12 20:45   ` Chris Larson
2013-09-17 13:35     ` Björn Stenberg
2013-09-19 11:47     ` Björn Stenberg
2013-09-19 15:04       ` Randy MacLeod
2013-09-20  9:17         ` Björn Stenberg
  -- strict thread matches above, loose matches on Subject: below --
2013-09-11  7:34 [PATCH 0/1] " rongqing.li
2013-09-11  7:34 ` [PATCH 1/1] " rongqing.li
2013-09-11  8:40   ` Richard Purdie
2013-09-11  9:02     ` Rongqing Li

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.