Re: [PATCH] gen_build_files.sh: Remove bashisms

2010-05-21 Thread Rob Landley
On Monday 17 May 2010 12:07:27 Cristian Ionescu-Idbohrn wrote: Oh boy... But then you'll also have to imitate those many intentional obscure bashisms in hush, will you not? Yes. This was always the plan. Adding support for things people actually _use_ to busybox is what busybox does. The

Re: [PATCH] gen_build_files.sh: Remove bashisms

2010-05-19 Thread Rob Landley
On Monday 17 May 2010 06:23:30 Natanael Copa wrote: On Fri, May 14, 2010 at 10:41 PM, Rob Landley r...@landley.net wrote: On Thursday 13 May 2010 18:05:53 Peter Tyser wrote: Using 'read' without a variable is not supported in many shells. Lines such as 'while read; do' in

Re: [PATCH] gen_build_files.sh: Remove bashisms

2010-05-19 Thread Rob Landley
On Tuesday 18 May 2010 17:54:44 Denys Vlasenko wrote: Hey Rob, please do abstain from biting our contributors. :) Ok. Sorry. Rob -- Latency is more important than throughput. It's that simple. - Linus Torvalds ___ busybox mailing list

Re: [PATCH] gen_build_files.sh: Remove bashisms

2010-05-18 Thread Cristian Ionescu-Idbohrn
On Mon, 17 May 2010, Paul Smith wrote: IMO if you want bash, get bash (and put #!/bin/bash at the top of your scripts). If you put #!/bin/sh at the top of your scripts, restrict yourself to POSIX shell features. On Mon, 2010-05-17 at 23:54 +0200, Cristian Ionescu-Idbohrn wrote: -

Re: [PATCH] gen_build_files.sh: Remove bashisms

2010-05-18 Thread Denys Vlasenko
On Mon, May 17, 2010 at 9:12 PM, Cathey, Jim jcat...@ciena.com wrote: We have embedded systems that don't have room for bash. I don't think bash provides that much useful stuff in its extensions that warrant locking ourselves to it. But then, the whole trend away from portable coding doesn't

Re: [PATCH] gen_build_files.sh: Remove bashisms

2010-05-18 Thread Denys Vlasenko
On Tue, May 18, 2010 at 1:03 PM, Cristian Ionescu-Idbohrn cristian.ionescu-idbo...@axis.com wrote: wrong. It eats leading and trailing whitespace. I cannot find anything in the opengroup page you earlier referred to:        

Re: [PATCH] gen_build_files.sh: Remove bashisms

2010-05-18 Thread Denys Vlasenko
On Monday 17 May 2010 02:23, Rob Landley wrote: On Saturday 15 May 2010 17:27:40 Cristian Ionescu-Idbohrn wrote: I had a look through and found: ,[ individual ] | possible bashism in individual line 15 (brace expansion): He changed the start to #!/bin/bash and you're still

Re: [PATCH] gen_build_files.sh: Remove bashisms

2010-05-17 Thread Cristian Ionescu-Idbohrn
On Sun, 16 May 2010, Rob Landley wrote: On Saturday 15 May 2010 13:30:51 Cristian Ionescu-Idbohrn wrote: Yes. A performant shell it's crucial in the embedded world, as an important part of cross-building and also running the target system. On the target use a busybox shell. Or

Re: [PATCH] gen_build_files.sh: Remove bashisms

2010-05-17 Thread Natanael Copa
On Fri, May 14, 2010 at 10:41 PM, Rob Landley r...@landley.net wrote: On Thursday 13 May 2010 18:05:53 Peter Tyser wrote: Using 'read' without a variable is not supported in many shells.  Lines such as 'while read; do' in gen_build_files.sh would result in build failures when using sh or dash

Re: [PATCH] gen_build_files.sh: Remove bashisms

2010-05-17 Thread Natanael Copa
On Sat, May 15, 2010 at 9:10 PM, Denys Vlasenko vda.li...@googlemail.com wrote: On Friday 14 May 2010 01:05, Peter Tyser wrote: -find -type d | while read; do -     d=$REPLY - +find -type d | while read d; do I applied this part, and changed #!/bin/sh to bash. Please keep the #!/bin/sh and

Re: [PATCH] gen_build_files.sh: Remove bashisms

2010-05-17 Thread Bernd Petrovitsch
On Mon, 2010-05-17 at 13:23 +0200, Natanael Copa wrote: On Fri, May 14, 2010 at 10:41 PM, Rob Landley r...@landley.net wrote: On Thursday 13 May 2010 18:05:53 Peter Tyser wrote: Using 'read' without a variable is not supported in many shells. Lines such as 'while read; do' in

Re: [PATCH] gen_build_files.sh: Remove bashisms

2010-05-17 Thread David N. Lombard
On Fri, May 14, 2010 at 01:52:24PM -0700, Cristian Ionescu-Idbohrn wrote: On Fri, 14 May 2010, Rob Landley wrote: On Thursday 13 May 2010 18:05:53 Peter Tyser wrote: Using 'read' without a variable is not supported in many shells. Lines such as 'while read; do' in gen_build_files.sh

Re: [PATCH] gen_build_files.sh: Remove bashisms

2010-05-17 Thread Cristian Ionescu-Idbohrn
On Sun, 16 May 2010, Rob Landley wrote: On Saturday 15 May 2010 17:27:40 Cristian Ionescu-Idbohrn wrote: Thank you. I had a look through and found: ,[ individual ] | possible bashism in individual line 15 (brace expansion): He changed the start to #!/bin/bash and you're

Re: [PATCH] gen_build_files.sh: Remove bashisms

2010-05-17 Thread Peter Tyser
But, we could still have fun discussing how we go about making the scripts as portable as possible and avoid breaking peoples builds, I presume. And this is, IMO, the main point to this flamy exchange of ideas. Take care Rob. And try to focus on the matter at hand, which should not be

Re: [PATCH] gen_build_files.sh: Remove bashisms

2010-05-17 Thread Denys Vlasenko
On Mon, May 17, 2010 at 7:28 PM, Peter Tyser pty...@xes-inc.com wrote: But, we could still have fun discussing how we go about making the scripts as portable as possible and avoid breaking peoples builds, I presume. And this is, IMO, the main point to this flamy exchange of ideas. Take care

Re: [PATCH] gen_build_files.sh: Remove bashisms

2010-05-17 Thread Peter Tyser
I also echo your opinions about keeping the scripts portable. I can sympathise with this point of view. However, I can see another point of view: Why, after years and years of happily using bash, everybody should be tortured now by being forced to work in a shell which: * does not

RE: [PATCH] gen_build_files.sh: Remove bashisms

2010-05-17 Thread Cathey, Jim
Message- From: busybox-boun...@busybox.net [mailto:busybox-boun...@busybox.net] On Behalf Of Peter Tyser Sent: Monday, May 17, 2010 12:03 PM To: Denys Vlasenko Cc: busybox@busybox.net Subject: Re: [PATCH] gen_build_files.sh: Remove bashisms I also echo your opinions about keeping the scripts

Re: [PATCH] gen_build_files.sh: Remove bashisms

2010-05-17 Thread Douglas Mencken
Patches welcome? Here's mine. License: Public domain. --- gen_build_files.sh 2010-05-17 22:00:34.912406823 +0200 +++ gen_build_files_fixed.sh2010-05-17 22:03:33.893406743 +0200 @@ -1,5 +1,6 @@ #!/bin/sh -# bashism: +# bashism removed: +# lines 22 and 48 had # read -r without variable name

Re: [PATCH] gen_build_files.sh: Remove bashisms

2010-05-17 Thread Denys Vlasenko
On Monday 17 May 2010 22:10, Douglas Mencken wrote: Patches welcome? Here's mine. License: Public domain. - while read -r; do - test x$REPLY = xINSERT REPLY=$s - printf %s\n $REPLY + while read -r reply; do +

Re: [PATCH] gen_build_files.sh: Remove bashisms

2010-05-17 Thread Cristian Ionescu-Idbohrn
On Sun, 16 May 2010, Cristian Ionescu-Idbohrn wrote: On Sat, 15 May 2010, Denys Vlasenko wrote: On Friday 14 May 2010 01:05, Peter Tyser wrote: -find -type d | while read; do - d=$REPLY - +find -type d | while read d; do I applied this part, and changed #!/bin/sh to bash.

Re: [PATCH] gen_build_files.sh: Remove bashisms

2010-05-17 Thread Denys Vlasenko
On Monday 17 May 2010 21:03, Peter Tyser wrote: I also echo your opinions about keeping the scripts portable. I can sympathise with this point of view. However, I can see another point of view: Why, after years and years of happily using bash, everybody should be tortured now

Re: [PATCH] gen_build_files.sh: Remove bashisms

2010-05-17 Thread Cristian Ionescu-Idbohrn
On Mon, 17 May 2010, Denys Vlasenko wrote: On Monday 17 May 2010 22:10, Douglas Mencken wrote: Patches welcome? Here's mine. License: Public domain. - while read -r; do - test x$REPLY = xINSERT REPLY=$s - printf %s\n $REPLY +

Re: [PATCH] gen_build_files.sh: Remove bashisms

2010-05-17 Thread Paul Smith
Definitely put me down in the camp that does NOT want to add a lot of bash-specific features to the default shell. The default shell should be POSIX, nothing more. Anything else runs the risk of introducing incompatibilities with standard POSIX scripts, resulting in failures! For example, what

Re: [PATCH] gen_build_files.sh: Remove bashisms

2010-05-16 Thread Rob Landley
On Saturday 15 May 2010 13:30:51 Cristian Ionescu-Idbohrn wrote: On Fri, 14 May 2010, Rob Landley wrote: And of course you program in shell for performance reasons. Yes. A performant shell it's crucial in the embedded world, as an important part of cross-building and also running the target

Re: [PATCH] gen_build_files.sh: Remove bashisms

2010-05-16 Thread Rob Landley
On Saturday 15 May 2010 13:10:08 Cristian Ionescu-Idbohrn wrote: On Fri, 14 May 2010, Rob Landley wrote: On Friday 14 May 2010 15:57:34 Cristian Ionescu-Idbohrn wrote: Yes. Horrid obfuscation. By the way, if you were making the argument this should work under busybox's own shells, I'd

Re: [PATCH] gen_build_files.sh: Remove bashisms

2010-05-16 Thread Rob Landley
On Saturday 15 May 2010 17:27:40 Cristian Ionescu-Idbohrn wrote: On Sat, 15 May 2010, Denys Vlasenko wrote: On Friday 14 May 2010 01:05, Peter Tyser wrote: -find -type d | while read; do - d=$REPLY - +find -type d | while read d; do I applied this part, and changed #!/bin/sh to

Re: [PATCH] gen_build_files.sh: Remove bashisms

2010-05-15 Thread Denys Vlasenko
On Friday 14 May 2010 22:52, Cristian Ionescu-Idbohrn wrote: On Fri, 14 May 2010, Rob Landley wrote: On Thursday 13 May 2010 18:05:53 Peter Tyser wrote: Using 'read' without a variable is not supported in many shells. Lines such as 'while read; do' in gen_build_files.sh would result in

Re: [PATCH] gen_build_files.sh: Remove bashisms

2010-05-15 Thread Cristian Ionescu-Idbohrn
On Fri, 14 May 2010, Rob Landley wrote: On Friday 14 May 2010 15:57:34 Cristian Ionescu-Idbohrn wrote: Yes. Horrid obfuscation. By the way, if you were making the argument this should work under busybox's own shells, I'd be all for it. You could even make a standards argment around

Re: [PATCH] gen_build_files.sh: Remove bashisms

2010-05-15 Thread Cristian Ionescu-Idbohrn
On Sat, 15 May 2010, Denys Vlasenko wrote: On Friday 14 May 2010 22:52, Cristian Ionescu-Idbohrn wrote: On Fri, 14 May 2010, Rob Landley wrote: Simple fix: say #!/bin/bash at the top of all shell scripts, always. Not surprisingly, I disagree :) dash is 5+ times faster than bash. I

Re: [PATCH] gen_build_files.sh: Remove bashisms

2010-05-15 Thread Cristian Ionescu-Idbohrn
On Fri, 14 May 2010, Rob Landley wrote: And of course you program in shell for performance reasons. Yes. A performant shell it's crucial in the embedded world, as an important part of cross-building and also running the target system. Debian is sucking in bad design decisions from Ubuntu,

Re: [PATCH] gen_build_files.sh: Remove bashisms

2010-05-15 Thread Denys Vlasenko
On Friday 14 May 2010 22:52, Peter Tyser wrote: On Fri, 2010-05-14 at 15:41 -0500, Rob Landley wrote: On Thursday 13 May 2010 18:05:53 Peter Tyser wrote: Using 'read' without a variable is not supported in many shells. Lines such as 'while read; do' in gen_build_files.sh would result in

Re: [PATCH] gen_build_files.sh: Remove bashisms

2010-05-15 Thread Denys Vlasenko
On Friday 14 May 2010 01:05, Peter Tyser wrote: -find -type d | while read; do - d=$REPLY - +find -type d | while read d; do I applied this part, and changed #!/bin/sh to bash. Thanks! -- vda ___ busybox mailing list busybox@busybox.net

Re: [PATCH] gen_build_files.sh: Remove bashisms

2010-05-15 Thread Cristian Ionescu-Idbohrn
On Sat, 15 May 2010, Denys Vlasenko wrote: On Friday 14 May 2010 01:05, Peter Tyser wrote: -find -type d | while read; do - d=$REPLY - +find -type d | while read d; do I applied this part, and changed #!/bin/sh to bash. Thanks! Thank you. I had a look through and found: ,[

Re: [PATCH] gen_build_files.sh: Remove bashisms

2010-05-14 Thread Rob Landley
On Thursday 13 May 2010 18:05:53 Peter Tyser wrote: Using 'read' without a variable is not supported in many shells. Lines such as 'while read; do' in gen_build_files.sh would result in build failures when using sh or dash as an interpreter: Simple fix: say #!/bin/bash at the top of all shell

Re: [PATCH] gen_build_files.sh: Remove bashisms

2010-05-14 Thread Cristian Ionescu-Idbohrn
On Fri, 14 May 2010, Rob Landley wrote: On Thursday 13 May 2010 18:05:53 Peter Tyser wrote: Using 'read' without a variable is not supported in many shells. Lines such as 'while read; do' in gen_build_files.sh would result in build failures when using sh or dash as an interpreter:

Re: [PATCH] gen_build_files.sh: Remove bashisms

2010-05-14 Thread Peter Tyser
On Fri, 2010-05-14 at 15:41 -0500, Rob Landley wrote: On Thursday 13 May 2010 18:05:53 Peter Tyser wrote: Using 'read' without a variable is not supported in many shells. Lines such as 'while read; do' in gen_build_files.sh would result in build failures when using sh or dash as an

Re: [PATCH] gen_build_files.sh: Remove bashisms

2010-05-14 Thread Rob Landley
On Friday 14 May 2010 15:52:24 Cristian Ionescu-Idbohrn wrote: On Fri, 14 May 2010, Rob Landley wrote: On Thursday 13 May 2010 18:05:53 Peter Tyser wrote: Using 'read' without a variable is not supported in many shells. Lines such as 'while read; do' in gen_build_files.sh would result in

Re: [PATCH] gen_build_files.sh: Remove bashisms

2010-05-14 Thread Rob Landley
On Friday 14 May 2010 15:57:34 Cristian Ionescu-Idbohrn wrote: On Fri, 14 May 2010, Peter Tyser wrote: I also personally prefer explicitly specifying a variable for 'read' instead of using the magical REPLY variable. Yes. Horrid obfuscation. By the way, if you were making the argument