Bug 2433

Summary: runqemu scripts in master broken by recent changes
Product: [Build System, Metadata & Runtime] Meta-yocto Reporter: Joshua Lock - Disabled <josh>
Component: meta-yoctoAssignee: Scott Garman <scott.a.garman>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: Medium CC: jiajun.xu, laurentiu.serban, poky.bs.watcher, poky.watcher, scott.a.garman, sgw, wuhanck
Version: unspecified   
Target Milestone: 1.3   
Hardware: x86   
OS: Multiple   
Whiteboard: (No QA needed)
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: ---

Description Joshua Lock - Disabled 2012-05-07 23:23:37 UTC
Changeset e99f652ede4612eec7cef5fa16638b07519cba8e broke the runqemu scripts for me. Specifically the findimage function.

http://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/?id=e99f652ede4612eec7cef5fa16638b07519cba8e

Before I could run:

$ runqemu qemuarm

and findimage would find an appropriate image to run. Now I see:

/srv/yocto/poky/scripts/runqemu: line 303: [: too many arguments

I'm using the base shell under Ubuntu 12.04 LTS. I am able to produce a similar error if I switch to dash.

The hunk which breaks things is:

- if [[ "$name" =~ core-image-sato-sdk ||
- "$name" =~ core-image-sato ||
- "$name" =~ core-image-lsb ||
- "$name" =~ core-image-basic ||
- "$name" =~ core-image-minimal ]]; then
+ 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

Although at least [[ is a bashism so we can't really just revert.
Comment 1 Richard Purdie 2012-05-08 09:22:24 UTC
A case statement should be able to resolve this as mentioned on list...
Comment 2 Saul Wold 2012-05-14 06:28:34 UTC
*** Bug 2449 has been marked as a duplicate of this bug. ***
Comment 3 Scott Garman 2012-05-21 16:34:54 UTC
This was fixed by Peter Seebach with this commit:

http://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/?id=441623224b73c82b4140aa9015823eb91a417cdc
Comment 4 Laurentiu Serban 2012-06-19 12:08:16 UTC
verified