Skip to contentSkip to conversation

icecc.bbclass: replace deprecated bash command substitution

PATCH Jose Quaresma 1 participant 1 message Jan 26, 2022 1 message not in the archive

lore
Share & tools
lore
#1 lore raw
In reply to a message not in the archive

ping

Jose Quaresma via lists.openembedded.org <quaresma.jose= [email protected]> escreveu no dia quarta, 19/01/2022 à(s) 23:07:

Quoted 87 lines

- build some packages with icecc enabled is not supported because of the folling that disables the icecc:

DEBUG: while parsing set_icecc_env, unable to handle non-literal command
'$ICECC_CC'

- it can be replicated with:

bitbake make && bitbake make -c cleansstate && bitbake make -DD grep ICECC_CC tmp/log/cooker/qemux86-64/console-latest.log

- bash command substitution backquote deprecated

https://www.gnu.org/software/bash/manual/html_node/Command-Substitution.html
https://mywiki.wooledge.org/BashFAQ/082

---
 meta/classes/icecc.bbclass | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)
meta/classes/icecc.bbclass +1 -3
index 794e9930ad..3bbd2645af 100644
@@ -309,7 +309,7 @@ wait_for_file() {
     local TIMEOUT=$2
     until [ -f "$FILE_TO_TEST" ]
     do
-        TIME_ELAPSED=`expr $TIME_ELAPSED + 1`
+        TIME_ELAPSED=$(expr $TIME_ELAPSED + 1)
         if [ $TIME_ELAPSED -gt $TIMEOUT ]
         then
             return 1
@@ -362,8 +362,8 @@ set_icecc_env() {
         return
     fi
 
-    ICE_VERSION=`$ICECC_CC -dumpversion`
-    ICECC_VERSION=`echo ${ICECC_VERSION} | sed -e "s/@VERSION@

/$ICE_VERSION/g"`

meta/classes/icecc.bbclass +2 -0
+    ICE_VERSION="$($ICECC_CC -dumpversion)"
+    ICECC_VERSION=$(echo ${ICECC_VERSION} | sed -e "s/@VERSION@

/$ICE_VERSION/g")
if [ ! -x "${ICECC_ENV_EXEC}" ]
then
bbwarn "Cannot use icecc: invalid ICECC_ENV_EXEC"

meta/classes/icecc.bbclass +1 -1
@@ -390,18 +390,18 @@ set_icecc_env() {
         chmod 775 $ICE_PATH/$compiler
     done
 
-    ICECC_AS="`${ICECC_CC} -print-prog-name=as`"
+    ICECC_AS="$(${ICECC_CC} -print-prog-name=as)"
     # for target recipes should return something like:
     #

/OE/tmp-eglibc/sysroots/x86_64-linux/usr/libexec/arm920tt-oe-linux-gnueabi/gcc/arm-oe-linux-gnueabi/4.8.2/as

     # and just "as" for native, if it returns "as" in current directory
(for whatever reason) use "as" from PATH
meta/classes/icecc.bbclass +2 -3
-    if [ "`dirname "${ICECC_AS}"`" = "." ]
+    if [ "$(dirname "${ICECC_AS}")" = "." ]
     then
         ICECC_AS="${ICECC_WHICH_AS}"
     fi
 
     if [ ! -f "${ICECC_VERSION}.done" ]
     then
-        mkdir -p "`dirname "${ICECC_VERSION}"`"
+        mkdir -p "$(dirname "${ICECC_VERSION}")"
 
         # the ICECC_VERSION generation step must be locked by a mutex
         # in order to prevent race conditions
--

2.34.1

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group. View/Reply Online (#160744):
https://lists.openembedded.org/g/openembedded-core/message/160744
Mute This Topic: https://lists.openembedded.org/mt/88547329/5052612
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [ [email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Signature · 3 lines
Best regards,

José Quaresma