diff options
author | Peter Seebach <peter.seebach@windriver.com> | 2012-05-14 17:49:23 -0500 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2012-05-15 18:51:13 +0100 |
commit | 441623224b73c82b4140aa9015823eb91a417cdc (patch) | |
tree | 4d618b49a3e0f59437391be4d7c3202120b455f1 /scripts | |
parent | 389de8a24f1774d53b6d46142d213c0542a279ba (diff) | |
download | poky-441623224b73c82b4140aa9015823eb91a417cdc.tar.gz |
runqemu: replace bashism with working shell idiom
The =~ operator is not one of my favorites, not just due to portability
issues, but because it's not well known, and a lot of people might
not expect a regex operator.
The canonical shell idiom for this is to use case with alternation
and wildcards. As a side note, if you are matching anything containing
core-image-sato, you don't need to also check for core-image-sato-sdk.
(From OE-Core rev: 716ae8dbd1fb29292c9fca0f59d3807a54508e87)
Signed-off-by: Peter Seebach <peter.seebach@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/runqemu | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/scripts/runqemu b/scripts/runqemu index 305e46aebf..fc7363fdd8 100755 --- a/scripts/runqemu +++ b/scripts/runqemu | |||
@@ -300,14 +300,15 @@ findimage() { | |||
300 | # recently created one is the one we most likely want to boot. | 300 | # recently created one is the one we most likely want to boot. |
301 | filenames=`ls -t $where/*-image*$machine.$extension 2>/dev/null | xargs` | 301 | filenames=`ls -t $where/*-image*$machine.$extension 2>/dev/null | xargs` |
302 | for name in $filenames; do | 302 | for name in $filenames; do |
303 | if [ "$name" =~ core-image-sato-sdk -o \ | 303 | case $name in |
304 | "$name" =~ core-image-sato -o \ | 304 | *core-image-sato* | \ |
305 | "$name" =~ core-image-lsb -o \ | 305 | *core-image-lsb* | \ |
306 | "$name" =~ core-image-basic -o \ | 306 | *core-image-basic* | \ |
307 | "$name" =~ core-image-minimal ]; then | 307 | *core-image-minimal* ) |
308 | ROOTFS=$name | 308 | ROOTFS=$name |
309 | return | 309 | return |
310 | fi | 310 | ;; |
311 | esac | ||
311 | done | 312 | done |
312 | 313 | ||
313 | echo "Couldn't find a $machine rootfs image in $where." | 314 | echo "Couldn't find a $machine rootfs image in $where." |