devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] fdtget-runtest.sh: use printf instead of /bin/echo -e
@ 2012-11-06 18:00 Stephen Warren
       [not found] ` <1352224831-1355-1-git-send-email-swarren-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
  0 siblings, 1 reply; 8+ messages in thread
From: Stephen Warren @ 2012-11-06 18:00 UTC (permalink / raw)
  To: David Gibson, jdl-CYoMK+44s/E, Mike Frysinger
  Cc: devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ, Stephen Warren

From: Stephen Warren <swarren-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>

Not all /bin/echo implementations support the -e option. Instead, use
printf, which appears to be more widely available than /bin/echo -e.

See commit eaec1db "fdtget-runtest.sh: Fix failures when /bin/sh isn't
bash" for history.

I have tested this on Ubuntu 10.04 with /bin/sh pointing to both dash
and bash.

Reported-by: Mike Frysinger <vapier-aBrp7R+bbdUdnm+yROfE0A@public.gmane.org> # and implemented-by
Signed-off-by: Stephen Warren <swarren-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
---
Mike, should I re-write this with you as the git author? If so, could
you please supply an S-o-b line for this?
---
 tests/fdtget-runtest.sh |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/tests/fdtget-runtest.sh b/tests/fdtget-runtest.sh
index c3a3559..8d8b058 100755
--- a/tests/fdtget-runtest.sh
+++ b/tests/fdtget-runtest.sh
@@ -8,7 +8,7 @@ rm -f $LOG $EXPECT
 trap "rm -f $LOG $EXPECT" 0
 
 expect="$1"
-/bin/echo -e $expect >$EXPECT
+printf '%b\n' "$expect" > $EXPECT
 shift
 
 verbose_run_log_check "$LOG" $VALGRIND $DTGET "$@"
-- 
1.7.0.4

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

* Re: [PATCH] fdtget-runtest.sh: use printf instead of /bin/echo -e
       [not found] ` <1352224831-1355-1-git-send-email-swarren-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
@ 2012-11-06 23:29   ` David Gibson
       [not found]     ` <20121106232920.GL23553-W9XWwYn+TF0XU02nzanrWNbf9cGiqdzd@public.gmane.org>
  2012-11-10  0:53   ` Mike Frysinger
  1 sibling, 1 reply; 8+ messages in thread
From: David Gibson @ 2012-11-06 23:29 UTC (permalink / raw)
  To: Stephen Warren; +Cc: Stephen Warren, devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ

On Tue, Nov 06, 2012 at 11:00:31AM -0700, Stephen Warren wrote:
> From: Stephen Warren <swarren-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
> 
> Not all /bin/echo implementations support the -e option. Instead, use
> printf, which appears to be more widely available than /bin/echo -e.
> 
> See commit eaec1db "fdtget-runtest.sh: Fix failures when /bin/sh isn't
> bash" for history.
> 
> I have tested this on Ubuntu 10.04 with /bin/sh pointing to both dash
> and bash.
> 
> Reported-by: Mike Frysinger <vapier-aBrp7R+bbdUdnm+yROfE0A@public.gmane.org> # and implemented-by
> Signed-off-by: Stephen Warren <swarren-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
> ---
> Mike, should I re-write this with you as the git author? If so, could
> you please supply an S-o-b line for this?
> ---
>  tests/fdtget-runtest.sh |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/tests/fdtget-runtest.sh b/tests/fdtget-runtest.sh
> index c3a3559..8d8b058 100755
> --- a/tests/fdtget-runtest.sh
> +++ b/tests/fdtget-runtest.sh
> @@ -8,7 +8,7 @@ rm -f $LOG $EXPECT
>  trap "rm -f $LOG $EXPECT" 0
>  
>  expect="$1"
> -/bin/echo -e $expect >$EXPECT
> +printf '%b\n' "$expect" > $EXPECT

Um.. this is made to apply on top of the /bin/echo patch, but AFAICT
that was never committed..

-- 
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson

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

* Re: [PATCH] fdtget-runtest.sh: use printf instead of /bin/echo -e
       [not found]     ` <20121106232920.GL23553-W9XWwYn+TF0XU02nzanrWNbf9cGiqdzd@public.gmane.org>
@ 2012-11-07  0:26       ` Stephen Warren
       [not found]         ` <5099AAA1.8090903-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
  0 siblings, 1 reply; 8+ messages in thread
From: Stephen Warren @ 2012-11-07  0:26 UTC (permalink / raw)
  To: David Gibson; +Cc: Stephen Warren, devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ

On 11/06/2012 04:29 PM, David Gibson wrote:
> On Tue, Nov 06, 2012 at 11:00:31AM -0700, Stephen Warren wrote:
>> From: Stephen Warren <swarren-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
>>
>> Not all /bin/echo implementations support the -e option. Instead, use
>> printf, which appears to be more widely available than /bin/echo -e.
>>
>> See commit eaec1db "fdtget-runtest.sh: Fix failures when /bin/sh isn't
>> bash" for history.
>>
>> I have tested this on Ubuntu 10.04 with /bin/sh pointing to both dash
>> and bash.
>>
>> Reported-by: Mike Frysinger <vapier-aBrp7R+bbdUdnm+yROfE0A@public.gmane.org> # and implemented-by
>> Signed-off-by: Stephen Warren <swarren-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
>> ---
>> Mike, should I re-write this with you as the git author? If so, could
>> you please supply an S-o-b line for this?
>> ---
>>  tests/fdtget-runtest.sh |    2 +-
>>  1 files changed, 1 insertions(+), 1 deletions(-)
>>
>> diff --git a/tests/fdtget-runtest.sh b/tests/fdtget-runtest.sh
>> index c3a3559..8d8b058 100755
>> --- a/tests/fdtget-runtest.sh
>> +++ b/tests/fdtget-runtest.sh
>> @@ -8,7 +8,7 @@ rm -f $LOG $EXPECT
>>  trap "rm -f $LOG $EXPECT" 0
>>  
>>  expect="$1"
>> -/bin/echo -e $expect >$EXPECT
>> +printf '%b\n' "$expect" > $EXPECT
> 
> Um.. this is made to apply on top of the /bin/echo patch, but AFAICT
> that was never committed..

I believe it's commit eaec1db "fdtget-runtest.sh: Fix failures when
/bin/sh isn't bash"; my local git certainly shows Jon as the committer
for that change.

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

* Re: [PATCH] fdtget-runtest.sh: use printf instead of /bin/echo -e
       [not found]         ` <5099AAA1.8090903-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
@ 2012-11-07  0:53           ` David Gibson
       [not found]             ` <20121107005338.GN23553-W9XWwYn+TF0XU02nzanrWNbf9cGiqdzd@public.gmane.org>
  0 siblings, 1 reply; 8+ messages in thread
From: David Gibson @ 2012-11-07  0:53 UTC (permalink / raw)
  To: Stephen Warren; +Cc: Stephen Warren, devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ

On Tue, Nov 06, 2012 at 05:26:09PM -0700, Stephen Warren wrote:
> On 11/06/2012 04:29 PM, David Gibson wrote:
> > On Tue, Nov 06, 2012 at 11:00:31AM -0700, Stephen Warren wrote:
> >> From: Stephen Warren <swarren-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
> >>
> >> Not all /bin/echo implementations support the -e option. Instead, use
> >> printf, which appears to be more widely available than /bin/echo -e.
> >>
> >> See commit eaec1db "fdtget-runtest.sh: Fix failures when /bin/sh isn't
> >> bash" for history.
> >>
> >> I have tested this on Ubuntu 10.04 with /bin/sh pointing to both dash
> >> and bash.
> >>
> >> Reported-by: Mike Frysinger <vapier-aBrp7R+bbdUdnm+yROfE0A@public.gmane.org> # and implemented-by
> >> Signed-off-by: Stephen Warren <swarren-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
> >> ---
> >> Mike, should I re-write this with you as the git author? If so, could
> >> you please supply an S-o-b line for this?
> >> ---
> >>  tests/fdtget-runtest.sh |    2 +-
> >>  1 files changed, 1 insertions(+), 1 deletions(-)
> >>
> >> diff --git a/tests/fdtget-runtest.sh b/tests/fdtget-runtest.sh
> >> index c3a3559..8d8b058 100755
> >> --- a/tests/fdtget-runtest.sh
> >> +++ b/tests/fdtget-runtest.sh
> >> @@ -8,7 +8,7 @@ rm -f $LOG $EXPECT
> >>  trap "rm -f $LOG $EXPECT" 0
> >>  
> >>  expect="$1"
> >> -/bin/echo -e $expect >$EXPECT
> >> +printf '%b\n' "$expect" > $EXPECT
> > 
> > Um.. this is made to apply on top of the /bin/echo patch, but AFAICT
> > that was never committed..
> 
> I believe it's commit eaec1db "fdtget-runtest.sh: Fix failures when
> /bin/sh isn't bash"; my local git certainly shows Jon as the committer
> for that change.

I just pulled from git.jdl.com and I don't see anything after
e4b497f367a3b2ae99cc52089a14a221b13a76ef, which was on Oct 16.

???

-- 
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson

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

* Re: [PATCH] fdtget-runtest.sh: use printf instead of /bin/echo -e
       [not found]             ` <20121107005338.GN23553-W9XWwYn+TF0XU02nzanrWNbf9cGiqdzd@public.gmane.org>
@ 2012-11-07  2:27               ` Stephen Warren
       [not found]                 ` <5099C70F.5040801-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
  0 siblings, 1 reply; 8+ messages in thread
From: Stephen Warren @ 2012-11-07  2:27 UTC (permalink / raw)
  To: David Gibson; +Cc: Stephen Warren, devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ

On 11/06/2012 05:53 PM, David Gibson wrote:
> On Tue, Nov 06, 2012 at 05:26:09PM -0700, Stephen Warren wrote:
>> On 11/06/2012 04:29 PM, David Gibson wrote:
>>> On Tue, Nov 06, 2012 at 11:00:31AM -0700, Stephen Warren wrote:
>>>> From: Stephen Warren <swarren-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
>>>>
>>>> Not all /bin/echo implementations support the -e option. Instead, use
>>>> printf, which appears to be more widely available than /bin/echo -e.
>>>>
>>>> See commit eaec1db "fdtget-runtest.sh: Fix failures when /bin/sh isn't
>>>> bash" for history.
>>>>
>>>> I have tested this on Ubuntu 10.04 with /bin/sh pointing to both dash
>>>> and bash.
>>>>
>>>> Reported-by: Mike Frysinger <vapier-aBrp7R+bbdUdnm+yROfE0A@public.gmane.org> # and implemented-by
>>>> Signed-off-by: Stephen Warren <swarren-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
>>>> ---
>>>> Mike, should I re-write this with you as the git author? If so, could
>>>> you please supply an S-o-b line for this?
>>>> ---
>>>>  tests/fdtget-runtest.sh |    2 +-
>>>>  1 files changed, 1 insertions(+), 1 deletions(-)
>>>>
>>>> diff --git a/tests/fdtget-runtest.sh b/tests/fdtget-runtest.sh
>>>> index c3a3559..8d8b058 100755
>>>> --- a/tests/fdtget-runtest.sh
>>>> +++ b/tests/fdtget-runtest.sh
>>>> @@ -8,7 +8,7 @@ rm -f $LOG $EXPECT
>>>>  trap "rm -f $LOG $EXPECT" 0
>>>>  
>>>>  expect="$1"
>>>> -/bin/echo -e $expect >$EXPECT
>>>> +printf '%b\n' "$expect" > $EXPECT
>>>
>>> Um.. this is made to apply on top of the /bin/echo patch, but AFAICT
>>> that was never committed..
>>
>> I believe it's commit eaec1db "fdtget-runtest.sh: Fix failures when
>> /bin/sh isn't bash"; my local git certainly shows Jon as the committer
>> for that change.
> 
> I just pulled from git.jdl.com and I don't see anything after
> e4b497f367a3b2ae99cc52089a14a221b13a76ef, which was on Oct 16.

Yes, Oct 16 is the last commit date I see too, but the patch was
committed long before that:

> commit eaec1dbc5946d5fd01a9ef7120f8461c74d759a0
> Author:     Stephen Warren <swarren-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
> AuthorDate: Tue Mar 20 20:23:46 2012 -0600
> Commit:     Jon Loeliger <jdl-CYoMK+44s/E@public.gmane.org>
> CommitDate: Sat Mar 31 09:00:29 2012 -0500
> 
>     fdtget-runtest.sh: Fix failures when /bin/sh isn't bash
>     
>     On Ubuntu, /bin/sh is dash (at least by default), and dash's echo doesn't
>     accept the -e option. This means that fdtget-runtest.sh's EXPECT file will
>     contain "-e foo" rather than just "foo", which causes a test failure.
>     
>     To work around this, run /bin/echo instead of (builtin) echo, which has
>     more chance of supporting the -e option.
>     
>     Another possible fix is to change all the #! lines to /bin/bash rather
>     than /bin/sh, and change run_tests.sh to invoke sub-scripts using $SHELL
>     instead of just "sh". However, that would require bash specifically, which
>     may not be desirable.
>     
>     Signed-off-by: Stephen Warren <swarren-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
>     Acked-by: David Gibson <david-xT8FGy+AXnRB3Ne2BGzF6laj5H9X9Tb+@public.gmane.org>

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

* Re: [PATCH] fdtget-runtest.sh: use printf instead of /bin/echo -e
       [not found]                 ` <5099C70F.5040801-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
@ 2012-11-07  2:42                   ` David Gibson
       [not found]                     ` <20121107024206.GP23553-W9XWwYn+TF0XU02nzanrWNbf9cGiqdzd@public.gmane.org>
  0 siblings, 1 reply; 8+ messages in thread
From: David Gibson @ 2012-11-07  2:42 UTC (permalink / raw)
  To: Stephen Warren; +Cc: Stephen Warren, devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ

On Tue, Nov 06, 2012 at 07:27:27PM -0700, Stephen Warren wrote:
> On 11/06/2012 05:53 PM, David Gibson wrote:
> > On Tue, Nov 06, 2012 at 05:26:09PM -0700, Stephen Warren wrote:
> >> On 11/06/2012 04:29 PM, David Gibson wrote:
> >>> On Tue, Nov 06, 2012 at 11:00:31AM -0700, Stephen Warren wrote:
> >>>> From: Stephen Warren <swarren-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
> >>>>
> >>>> Not all /bin/echo implementations support the -e option. Instead, use
> >>>> printf, which appears to be more widely available than /bin/echo -e.
> >>>>
> >>>> See commit eaec1db "fdtget-runtest.sh: Fix failures when /bin/sh isn't
> >>>> bash" for history.
> >>>>
> >>>> I have tested this on Ubuntu 10.04 with /bin/sh pointing to both dash
> >>>> and bash.
> >>>>
> >>>> Reported-by: Mike Frysinger <vapier-aBrp7R+bbdUdnm+yROfE0A@public.gmane.org> # and implemented-by
> >>>> Signed-off-by: Stephen Warren <swarren-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
> >>>> ---
> >>>> Mike, should I re-write this with you as the git author? If so, could
> >>>> you please supply an S-o-b line for this?
> >>>> ---
> >>>>  tests/fdtget-runtest.sh |    2 +-
> >>>>  1 files changed, 1 insertions(+), 1 deletions(-)
> >>>>
> >>>> diff --git a/tests/fdtget-runtest.sh b/tests/fdtget-runtest.sh
> >>>> index c3a3559..8d8b058 100755
> >>>> --- a/tests/fdtget-runtest.sh
> >>>> +++ b/tests/fdtget-runtest.sh
> >>>> @@ -8,7 +8,7 @@ rm -f $LOG $EXPECT
> >>>>  trap "rm -f $LOG $EXPECT" 0
> >>>>  
> >>>>  expect="$1"
> >>>> -/bin/echo -e $expect >$EXPECT
> >>>> +printf '%b\n' "$expect" > $EXPECT
> >>>
> >>> Um.. this is made to apply on top of the /bin/echo patch, but AFAICT
> >>> that was never committed..
> >>
> >> I believe it's commit eaec1db "fdtget-runtest.sh: Fix failures when
> >> /bin/sh isn't bash"; my local git certainly shows Jon as the committer
> >> for that change.
> > 
> > I just pulled from git.jdl.com and I don't see anything after
> > e4b497f367a3b2ae99cc52089a14a221b13a76ef, which was on Oct 16.
> 
> Yes, Oct 16 is the last commit date I see too, but the patch was
> committed long before that:

Ah, so it was.  I didn't realise there had been such a long delay
between the initial patch and this discussion.

-- 
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson

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

* Re: [PATCH] fdtget-runtest.sh: use printf instead of /bin/echo -e
       [not found] ` <1352224831-1355-1-git-send-email-swarren-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
  2012-11-06 23:29   ` David Gibson
@ 2012-11-10  0:53   ` Mike Frysinger
  1 sibling, 0 replies; 8+ messages in thread
From: Mike Frysinger @ 2012-11-10  0:53 UTC (permalink / raw)
  To: Stephen Warren; +Cc: Stephen Warren, devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ


[-- Attachment #1.1: Type: Text/Plain, Size: 148 bytes --]

On Tuesday 06 November 2012 13:00:31 Stephen Warren wrote:
> Mike, should I re-write this with you as the git author?


nah, you did the work
-mike

[-- Attachment #1.2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

[-- Attachment #2: Type: text/plain, Size: 192 bytes --]

_______________________________________________
devicetree-discuss mailing list
devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org
https://lists.ozlabs.org/listinfo/devicetree-discuss

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

* Re: [PATCH] fdtget-runtest.sh: use printf instead of /bin/echo -e
       [not found]                     ` <20121107024206.GP23553-W9XWwYn+TF0XU02nzanrWNbf9cGiqdzd@public.gmane.org>
@ 2012-11-10  0:54                       ` Mike Frysinger
  0 siblings, 0 replies; 8+ messages in thread
From: Mike Frysinger @ 2012-11-10  0:54 UTC (permalink / raw)
  To: David Gibson; +Cc: Stephen Warren, devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ


[-- Attachment #1.1: Type: Text/Plain, Size: 249 bytes --]

On Tuesday 06 November 2012 21:42:06 David Gibson wrote:
> Ah, so it was.  I didn't realise there had been such a long delay
> between the initial patch and this discussion.

yes, i was perusing my backlog on the list when i came across it ;)
-mike

[-- Attachment #1.2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

[-- Attachment #2: Type: text/plain, Size: 192 bytes --]

_______________________________________________
devicetree-discuss mailing list
devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org
https://lists.ozlabs.org/listinfo/devicetree-discuss

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

end of thread, other threads:[~2012-11-10  0:54 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-11-06 18:00 [PATCH] fdtget-runtest.sh: use printf instead of /bin/echo -e Stephen Warren
     [not found] ` <1352224831-1355-1-git-send-email-swarren-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
2012-11-06 23:29   ` David Gibson
     [not found]     ` <20121106232920.GL23553-W9XWwYn+TF0XU02nzanrWNbf9cGiqdzd@public.gmane.org>
2012-11-07  0:26       ` Stephen Warren
     [not found]         ` <5099AAA1.8090903-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
2012-11-07  0:53           ` David Gibson
     [not found]             ` <20121107005338.GN23553-W9XWwYn+TF0XU02nzanrWNbf9cGiqdzd@public.gmane.org>
2012-11-07  2:27               ` Stephen Warren
     [not found]                 ` <5099C70F.5040801-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
2012-11-07  2:42                   ` David Gibson
     [not found]                     ` <20121107024206.GP23553-W9XWwYn+TF0XU02nzanrWNbf9cGiqdzd@public.gmane.org>
2012-11-10  0:54                       ` Mike Frysinger
2012-11-10  0:53   ` Mike Frysinger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).