<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">&lt;<a href="mailto:rpjday@crashcourse.ca" target="_blank">rpjday@crashcourse.ca</a>&gt;</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&#39;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 [ &quot;x${UBOOT_SIGN_ENABLE}&quot; = &quot;x1&quot; ] ; then<br>
<br>
surely we don&#39;t still need to use that ugly &quot;x&quot; 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 &quot;fitImage&quot; &amp;&amp; \<br>
                test -n &quot;${INITRAMFS_IMAGE}&quot; ; then<br>
<br>
would it not be equivalent to write that second test as:<br>
<br>
  [ -n &quot;${INITRAMFS_IMAGE}&quot;]<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&#39;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>