Skip to contentSkip to conversation

gcc-runtime: remove bashism

PATCH Marko, Peter 2 participants 2 messages Sep 2, 2023 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw

Gentle ping.
Thanks.

-----Original Message-----
From: [email protected] <[email protected]> On Behalf Of Peter Marko via lists.openembedded.org
Sent: Tuesday, August 1, 2023 8:19
To: [email protected]
Cc: Marko, Peter (ADV D EU SK BFS1) <[email protected]>
Subject: [OE-core][PATCH] gcc-runtime: remove bashism

Quoted 28 lines

From: Peter Marko <[email protected]>

Debian 12 no longer supports replacing dash with bash as default shell. Therefore to achieve compatibility with Debian 12, all bashisms need to be removed.

Shell comparison via == gives an error with dash and thus the condition is always false.

---
 meta/recipes-devtools/gcc/gcc-runtime.inc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
meta/recipes-devtools/gcc/gcc-runtime.inc +2 -2
index bccc8a5b89..64b6168ba7 100644
@@ -132,7 +132,7 @@ do_install:append:class-target () {
 		ln -s ../${TARGET_SYS}/ext ${D}${includedir}/c++/${BINV}/${TARGET_ARCH}${TARGET_VENDOR_MULTILIB_ORIGINAL}-${TARGET_OS}/ext
 	fi
 
-	if [ "${TARGET_ARCH}" == "x86_64" -a "${MULTILIB_VARIANTS}" != "" ];then
+	if [ "${TARGET_ARCH}" = "x86_64" -a "${MULTILIB_VARIANTS}" != "" 
+];then
 		ln -sf ../${X86ARCH32}${TARGET_VENDOR}-${TARGET_OS} ${D}${includedir}/c++/${BINV}/${TARGET_ARCH}${TARGET_VENDOR}-${TARGET_OS}/32
 	fi
 
--

2.30.2

#2 lore raw
Quoted 38 lines

-----Original Message-----
From: [email protected] <[email protected]> On Behalf Of Peter Marko via lists.openembedded.org
Sent: den 2 september 2023 11:54
To: [email protected]
Subject: Re: [OE-core][PATCH] gcc-runtime: remove bashism

Gentle ping.
Thanks.

-----Original Message-----
From: [email protected] <[email protected]> On Behalf Of Peter Marko via lists.openembedded.org
Sent: Tuesday, August 1, 2023 8:19
To: [email protected]
Cc: Marko, Peter (ADV D EU SK BFS1) <[email protected]>
Subject: [OE-core][PATCH] gcc-runtime: remove bashism

Quoted 20 lines

From: Peter Marko <[email protected]>

Debian 12 no longer supports replacing dash with bash as default shell. Therefore to achieve compatibility with Debian 12, all bashisms need to be removed.

Shell comparison via == gives an error with dash and thus the condition is always false.

---
 meta/recipes-devtools/gcc/gcc-runtime.inc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
meta/recipes-devtools/gcc/gcc-runtime.inc +0 -0
index bccc8a5b89..64b6168ba7 100644
@@ -132,7 +132,7 @@ do_install:append:class-target () {
 		ln -s ../${TARGET_SYS}/ext ${D}${includedir}/c++/${BINV}/${TARGET_ARCH}${TARGET_VENDOR_MULTILIB_ORIGINAL}-${TARGET_OS}/ext
 	fi
 
Quoted 3 lines

meta/recipes-devtools/gcc/gcc-runtime.inc do_install:append:class-target () { · line 136

Quoted 3 lines
meta/recipes-devtools/gcc/gcc-runtime.inc +2 -1
-	if [ "${TARGET_ARCH}" == "x86_64" -a "${MULTILIB_VARIANTS}" != "" ];then
+	if [ "${TARGET_ARCH}" = "x86_64" -a "${MULTILIB_VARIANTS}" != ""
+];then

Change that to:

	if [ "${TARGET_ARCH}" = x86_64 ] && [ "${MULTILIB_VARIANTS}" ]; then

* Static strings without spaces and special characters do not need quotes.
* You want to avoid the -a and -o operators for test.
* Checking that a string has a value does not need the != "".
* There is no reason to break the line.

Quoted 5 lines
Quoted 5 lines
meta/recipes-devtools/gcc/gcc-runtime.inc +0 -1
 		ln -sf ../${X86ARCH32}${TARGET_VENDOR}-${TARGET_OS} ${D}${includedir}/c++/${BINV}/${TARGET_ARCH}${TARGET_VENDOR}-${TARGET_OS}/32
 	fi
 
--

2.30.2

//Peter