summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorPeter Seebach <peter.seebach@windriver.com>2012-05-14 17:49:23 -0500
committerRichard Purdie <richard.purdie@linuxfoundation.org>2012-05-15 18:44:36 +0100
commit716ae8dbd1fb29292c9fca0f59d3807a54508e87 (patch)
tree872606b0412ae277a3c8e67cf8f9bd0e3293f4ea /scripts
parent30708f1b5bc3844e080ef863fdd22446700ba0b1 (diff)
downloadopenembedded-core-716ae8dbd1fb29292c9fca0f59d3807a54508e87.tar.gz
openembedded-core-716ae8dbd1fb29292c9fca0f59d3807a54508e87.tar.bz2
openembedded-core-716ae8dbd1fb29292c9fca0f59d3807a54508e87.zip
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. Signed-off-by: Peter Seebach <peter.seebach@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/runqemu13
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() {
# recently created one is the one we most likely want to boot.
filenames=`ls -t $where/*-image*$machine.$extension 2>/dev/null | xargs`
for name in $filenames; do
- if [ "$name" =~ core-image-sato-sdk -o \
- "$name" =~ core-image-sato -o \
- "$name" =~ core-image-lsb -o \
- "$name" =~ core-image-basic -o \
- "$name" =~ core-image-minimal ]; then
+ case $name in
+ *core-image-sato* | \
+ *core-image-lsb* | \
+ *core-image-basic* | \
+ *core-image-minimal* )
ROOTFS=$name
return
- fi
+ ;;
+ esac
done
echo "Couldn't find a $machine rootfs image in $where."