]> code.ossystems Code Review - openembedded-core.git/commitdiff
openssl: fix bashism in c_rehash shell script
authorAndré Draszik <adraszik@tycoint.com>
Wed, 9 Nov 2016 14:48:53 +0000 (14:48 +0000)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Wed, 11 Jan 2017 11:46:39 +0000 (11:46 +0000)
This script claims to be a /bin/sh script, but it uses
a bashism:

from checkbashisms:

possible bashism in meta/recipes-connectivity/openssl/openssl/openssl-c_rehash.sh line 151 (should be 'b = a'):
    if [ "x/" == "x$( echo ${FILE} | cut -c1 -)" ]

This causes build issues on systems that don't have
/bin/sh symlinked to bash:

Updating certificates in ${WORKDIR}/rootfs/etc/ssl/certs...
<builddir>/tmp/sysroots/x86_64-linux/usr/bin/c_rehash: 151: [: x/: unexpected operator
 ...

Fix this by using POSIX shell syntax for the comparison.

(From OE-Core rev: 0526524c74d4c9019fb014a2984119987f6ce9d3)

Signed-off-by: André Draszik <adraszik@tycoint.com>
Reviewed-by: Sylvain Lemieux <slemieux@tycoint.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Armin Kuster <akuster808@gmail.com>
meta/recipes-connectivity/openssl/openssl/openssl-c_rehash.sh

index 25ea729ac172e6572b9ff2917f52bb338d88e00a..6620fdcb53f795b7ee4b6e2ecc3ccc389c70326a 100644 (file)
@@ -148,7 +148,7 @@ hash_dir()
        then
            FILE=$( readlink ${FILE} )
            # check the symlink is absolute (or dangling in other word)
-           if [ "x/" == "x$( echo ${FILE} | cut -c1 -)" ]
+           if [ "x/" = "x$( echo ${FILE} | cut -c1 -)" ]
            then
                REAL_FILE=${SYSROOT}/${FILE}
            fi