Skip to contentSkip to conversation

openssl: fix bashism in c_rehash shell script

PATCH New André Draszik 1 participant 1 message Nov 9, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 openssl: fix bashism in c_rehash shell script

From: André Draszik <[email protected]>

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.

---
 meta/recipes-connectivity/openssl/openssl/openssl-c_rehash.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
meta/recipes-connectivity/openssl/openssl/openssl-c_rehash.sh +1 -1
index 25ea729..6620fdc 100644
@@ -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
Signature · 1 line
2.10.2