Re: [OE-core] shell script guidelines in oe-core? (was Re: [PATCH v4] create-pull-request: cleanup bashisms)

2015-08-17 Thread Otavio Salvador
On Mon, Aug 17, 2015 at 3:14 AM, mikko.rap...@bmw.de wrote: On Sat, Aug 15, 2015 at 06:38:18PM -0700, Christopher Larson wrote: Update: checkbashisms and shellcheck both check for this now. This is great! How about formulating that oe-core shell scripts should pass shellcheck and

Re: [OE-core] shell script guidelines in oe-core? (was Re: [PATCH v4] create-pull-request: cleanup bashisms)

2015-08-17 Thread Mikko.Rapeli
On Sat, Aug 15, 2015 at 06:38:18PM -0700, Christopher Larson wrote: Update: checkbashisms and shellcheck both check for this now. This is great! How about formulating that oe-core shell scripts should pass shellcheck and checkbashisms checks without warnings? -Mikko --

Re: [OE-core] shell script guidelines in oe-core? (was Re: [PATCH v4] create-pull-request: cleanup bashisms)

2015-08-15 Thread Christopher Larson
On Fri, Aug 14, 2015 at 3:01 PM, Christopher Larson clar...@kergoth.com wrote: On Wed, Aug 12, 2015 at 11:27 PM, mikko.rap...@bmw.de wrote: On Wed, Aug 12, 2015 at 10:51:26AM -0700, Christopher Larson wrote: That reminds me, there's a shell portability issue / standards-complaince issue

Re: [OE-core] shell script guidelines in oe-core? (was Re: [PATCH v4] create-pull-request: cleanup bashisms)

2015-08-14 Thread Christopher Larson
On Wed, Aug 12, 2015 at 11:27 PM, mikko.rap...@bmw.de wrote: On Wed, Aug 12, 2015 at 10:51:26AM -0700, Christopher Larson wrote: That reminds me, there's a shell portability issue / standards-complaince issue that's not identified by shellcheck. Typically, to negate a bracket expression

Re: [OE-core] shell script guidelines in oe-core? (was Re: [PATCH v4] create-pull-request: cleanup bashisms)

2015-08-13 Thread Mikko.Rapeli
On Wed, Aug 12, 2015 at 10:51:26AM -0700, Christopher Larson wrote: That reminds me, there's a shell portability issue / standards-complaince issue that's not identified by shellcheck. Typically, to negate a bracket expression in a regular expression, one uses ^, e.g. [^a-z] is everything

[OE-core] shell script guidelines in oe-core? (was Re: [PATCH v4] create-pull-request: cleanup bashisms)

2015-08-12 Thread Mikko.Rapeli
Sorry to hijack the thread but... On Wed, Aug 12, 2015 at 12:33:31PM +0300, Ed Bartosh wrote: Made create-pull-request POSIX compatible: - Replaced /bin/bash - /bin/sh in shebang. - Replaced usage of pushd/popd with generic shell commands. - Tested on zsh and dash. This reminded me

Re: [OE-core] shell script guidelines in oe-core? (was Re: [PATCH v4] create-pull-request: cleanup bashisms)

2015-08-12 Thread Khem Raj
On Wed, Aug 12, 2015 at 2:49 AM, mikko.rap...@bmw.de wrote: This reminded me of the problems I've seen with various oe-core shell scripts: they are missing systematic error handling. IMO using bash and 'set -euxo pipefail' are a good approach to catch errors early in shell scripts. Manually

Re: [OE-core] shell script guidelines in oe-core? (was Re: [PATCH v4] create-pull-request: cleanup bashisms)

2015-08-12 Thread Christopher Larson
On Wed, Aug 12, 2015 at 10:46 AM, Christopher Larson clar...@kergoth.com wrote: On Wed, Aug 12, 2015 at 9:56 AM, Khem Raj raj.k...@gmail.com wrote: On Wed, Aug 12, 2015 at 2:49 AM, mikko.rap...@bmw.de wrote: This reminded me of the problems I've seen with various oe-core shell scripts:

Re: [OE-core] shell script guidelines in oe-core? (was Re: [PATCH v4] create-pull-request: cleanup bashisms)

2015-08-12 Thread Christopher Larson
On Wed, Aug 12, 2015 at 9:56 AM, Khem Raj raj.k...@gmail.com wrote: On Wed, Aug 12, 2015 at 2:49 AM, mikko.rap...@bmw.de wrote: This reminded me of the problems I've seen with various oe-core shell scripts: they are missing systematic error handling. IMO using bash and 'set -euxo