[OE-core] what shell programming constructs can we count on in .bbclass files?

Robert P. J. Day rpjday at crashcourse.ca
Wed Mar 15 10:44:38 UTC 2017


  what shell (or level of POSIX compatibility) does one assume for
writing shell functions in .bbclass files?

  i'm looking at kernel-fitimage.bbclass and i see this:

  #
  # Step 7: Sign the image and add public key to U-Boot dtb
  #
  if [ "x${UBOOT_SIGN_ENABLE}" = "x1" ] ; then

surely we don't still need to use that ugly "x" prefix hack for string
comparisons, do we?

  a bit further down:

  do_assemble_fitimage_initramfs() {
        if echo ${KERNEL_IMAGETYPES} | grep -wq "fitImage" && \
                test -n "${INITRAMFS_IMAGE}" ; then

would it not be equivalent to write that second test as:

  [ -n "${INITRAMFS_IMAGE}"]

and so on. what are we allowed to count on?

rday

-- 

========================================================================
Robert P. J. Day                                 Ottawa, Ontario, CANADA
                        http://crashcourse.ca

Twitter:                                       http://twitter.com/rpjday
LinkedIn:                               http://ca.linkedin.com/in/rpjday
========================================================================




More information about the Openembedded-core mailing list