All of lore.kernel.org
 help / color / mirror / Atom feed
* Use of == in shell scripts
@ 2010-10-26 15:31 Andreas Oberritter
  2010-10-26 15:47 ` Andreas Oberritter
  2010-10-26 15:51 ` Maupin, Chase
  0 siblings, 2 replies; 11+ messages in thread
From: Andreas Oberritter @ 2010-10-26 15:31 UTC (permalink / raw)
  To: openembedded-devel

Dear all,

I noticed a common mistake in various OE recipes, classes and contrib
scripts: Instead of =, == is used as equality operator, in at least 91
places in 64 files (without recipes/obsolete: 83 in 60 files). This
isn't a problem with bash, but it isn't the standard syntax and at least
dash does not support it.

I used the following command line to find the occurences:

git grep 'if\s*\[.*==.*\]'

This command fixes all occurences:

for i in `git grep -l 'if\s*\[.*==.*\]'`; do
	sed -i $i -e 's,\(if\s*\[.*\)==\(.*\]\),\1=\2,';
done

One of the matches is a false positive:
recipes/uclibc/uclibc-0.9.29/uClibc-0.9.29-nonposix_bashisms.patch

How do I submit such a patch? 60 patches may be too much for such a
relatively simple change, but, on the other hand, everything in a single
patch may be unhandy as well.

How about splitting it into 5 patches?

- classes (7 files)
- contrib (4 files)
- recipes/*/*.bb (24 files)
- recipes/*/*.inc (14 files)
- other files in recipes except recipes/obsolete (11 files)

Any opinions?

Regards,
Andreas



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

end of thread, other threads:[~2010-11-14 23:41 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-10-26 15:31 Use of == in shell scripts Andreas Oberritter
2010-10-26 15:47 ` Andreas Oberritter
2010-10-26 16:29   ` Michael Smith
2010-10-26 23:36     ` Andreas Oberritter
2010-10-27  1:47       ` Mike Detwiler
2010-11-13 16:10       ` Andreas Oberritter
2010-11-14 23:40         ` Michael Smith
2010-10-26 15:51 ` Maupin, Chase
2010-10-26 16:03   ` Chris Larson
2010-10-26 16:11   ` Andreas Oberritter
2010-10-26 16:21     ` Michael Smith

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.