<div dir="ltr"><div class="gmail_extra"><br><div class="gmail_quote">On 15 March 2017 at 10:44, Robert P. J. Day <span dir="ltr"><<a href="mailto:rpjday@crashcourse.ca" target="_blank">rpjday@crashcourse.ca</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div id=":3gk" class="a3s aXjCH m15ad192f36ca4fe8"> what shell (or level of POSIX compatibility) does one assume for<br>
writing shell functions in .bbclass files?<br>
<br>
i'm looking at kernel-fitimage.bbclass and i see this:<br>
<br>
#<br>
# Step 7: Sign the image and add public key to U-Boot dtb<br>
#<br>
if [ "x${UBOOT_SIGN_ENABLE}" = "x1" ] ; then<br>
<br>
surely we don't still need to use that ugly "x" prefix hack for string<br>
comparisons, do we?<br>
<br>
a bit further down:<br>
<br>
do_assemble_fitimage_<wbr>initramfs() {<br>
if echo ${KERNEL_IMAGETYPES} | grep -wq "fitImage" && \<br>
test -n "${INITRAMFS_IMAGE}" ; then<br>
<br>
would it not be equivalent to write that second test as:<br>
<br>
[ -n "${INITRAMFS_IMAGE}"]<br>
<br>
and so on. what are we allowed to count on?<br></div></blockquote></div><br>xFOO = xBAR appears to be a long-standing hangover from the 70s, any POSIX shell should be safe with quoted instead.</div><div class="gmail_extra"><br></div><div class="gmail_extra">Our shell parser *should* be POSIX compliant. There are a few places where it isn't, but I believe those should be considered bugs. At the end of the day the shell is actually executed by /bin/sh or /bin/bash anyway, so as long as bitbake can parse it you can use anything.</div><div class="gmail_extra"><br></div><div class="gmail_extra">Ross</div></div>