Bug 5945

Summary: lsbtest doesn't work with dash
Product: [Runtime] General Runtime Reporter: Stoicescu Cornel <corneliux.stoicescu>
Component: General RuntimeAssignee: Stefan Stanacar <sstncr>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: Medium CC: bluelightning
Version: 1.4   
Target Milestone: 1.6 M4   
Hardware: x86   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: New (Never tested)
Verified: Documentation change: No (bug/feature does not impact docs)

Description Stoicescu Cornel 2014-03-11 16:03:35 UTC
Tested on Ubuntu 13.10 with:
1) Latest poky master:5f81d9d1fa537445d5da49e12de1e16300e94552
2) Yocto 1.4.3 RC3, dylan:7ab82abcad9ede847c42c01d2a4f4c2c18877e6f

Steps to reproduce:

1. 'bitbake lsbtest'. Notice recipe builds successfully. 
2. look inside log.do_install for lsbtest

Notice errors:
DEBUG: Executing shell function do_install
/home/cornel/SSD/poky/2build/tmp/work/i586-poky-linux/lsbtest/1.0-r3/temp/run.do_install.18156: 107: [: i586: unexpected operator
/home/cornel/SSD/poky/2build/tmp/work/i586-poky-linux/lsbtest/1.0-r3/temp/run.do_install.18156: 111: [: i586: unexpected operator
/home/cornel/SSD/poky/2build/tmp/work/i586-poky-linux/lsbtest/1.0-r3/temp/run.do_install.18156: 115: [: i586: unexpected operator
/home/cornel/SSD/poky/2build/tmp/work/i586-poky-linux/lsbtest/1.0-r3/temp/run.do_install.18156: 125: [: i586: unexpected operator
DEBUG: Shell function do_install finished

EXPECTED OUTCOME: Task do_install should have failed

NOTE: My system uses dash as system shell:
cornel@NODE-3:$ ls -l /bin/sh
lrwxrwxrwx 1 root root 4 Feb 13 16:56 /bin/sh -> dash

Dash does not correctly parse the following type of statement:
#!/bin/sh
if [ "i586" == "i586" ];then
...

This requires either we use bash specifically or we correct the statement like this:
#!/bin/sh
if [ "i586" = "i586" ];then
...


Because this is an issue with both 1.4.3 and master and I believe it was always there, I am setting this under Yocto 1.4 version. We never discovered this because we never built lsb images using distributions that use dash as system shell, like Ubuntu 13.10 .
Comment 1 Saul Wold 2014-03-12 00:31:59 UTC
Patch provided already!
Comment 2 Stoicescu Cornel 2014-03-12 07:26:33 UTC
There is also the issue where do_install task passed when it should have failed. Should I  open a new bug for this?
Comment 3 Stefan Stanacar 2014-03-27 16:56:39 UTC
Cornel: yes, I think that's a different issue than the one with package not working as expected. If that happens on master with this reverted it should be a different bug.
Comment 5 Stoicescu Cornel 2014-04-15 12:21:24 UTC
The fixes worked in both 1.4.3 and 1.6 master. Setting to VERIFIED.