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>
This commit is contained in:
parent
389de8a24f
commit
441623224b
|
@ -300,14 +300,15 @@ findimage() {
|
||||||
# recently created one is the one we most likely want to boot.
|
# recently created one is the one we most likely want to boot.
|
||||||
filenames=`ls -t $where/*-image*$machine.$extension 2>/dev/null | xargs`
|
filenames=`ls -t $where/*-image*$machine.$extension 2>/dev/null | xargs`
|
||||||
for name in $filenames; do
|
for name in $filenames; do
|
||||||
if [ "$name" =~ core-image-sato-sdk -o \
|
case $name in
|
||||||
"$name" =~ core-image-sato -o \
|
*core-image-sato* | \
|
||||||
"$name" =~ core-image-lsb -o \
|
*core-image-lsb* | \
|
||||||
"$name" =~ core-image-basic -o \
|
*core-image-basic* | \
|
||||||
"$name" =~ core-image-minimal ]; then
|
*core-image-minimal* )
|
||||||
ROOTFS=$name
|
ROOTFS=$name
|
||||||
return
|
return
|
||||||
fi
|
;;
|
||||||
|
esac
|
||||||
done
|
done
|
||||||
|
|
||||||
echo "Couldn't find a $machine rootfs image in $where."
|
echo "Couldn't find a $machine rootfs image in $where."
|
||||||
|
|
Loading…
Reference in New Issue