Skip to contentSkip to conversation

populate_sdk_base: Fix condition syntax if SDK_RELOCATE_AFTER_INSTALL is disabled

PATCH New Tomasz Dziendzielski 1 participant 1 message Dec 22, 2020

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 populate_sdk_base: Fix condition syntax if SDK_RELOCATE_AFTER_INSTALL is disabled

If variable is set to empty string the comparison is "if [ -eq 1 ]" which fails with "[: -eq: unary operator expected".

---
 meta/classes/populate_sdk_base.bbclass | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
meta/classes/populate_sdk_base.bbclass +1 -1
index 49b1833265..4db0511dba 100644
@@ -263,7 +263,7 @@ fakeroot create_shar() {
 
 	rm -f ${T}/pre_install_command ${T}/post_install_command
 
-	if [ ${SDK_RELOCATE_AFTER_INSTALL} -eq 1 ] ; then
+	if [ "${SDK_RELOCATE_AFTER_INSTALL}" = "1" ] ; then
 		cp ${TOOLCHAIN_SHAR_REL_TMPL} ${T}/post_install_command
 	fi
 	cat << "EOF" >> ${T}/pre_install_command
Signature · 1 line
2.29.2