Skip to contentSkip to conversation

pm-qa: fix paths for shell scripts

PATCH In review Anastasios Kavoukis 2 participants 2 messages Jul 28, 2021

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 pm-qa: fix paths for shell scripts

A commit in the repo of pm-qa:

"adf9df9 Fix path to library files and change shebang line"

Changed the text that sed was using to replace relative to absolute paths.

As a result sed was not effectively finding the text "source ../include" to replace it, as the sed should be now searching for ". ../include".

Similarly for "../Switches"

---
 meta-oe/recipes-test/pm-qa/pm-qa_git.bb | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
meta-oe/recipes-test/pm-qa/pm-qa_git.bb +2 -1
index 7e9971ea4..9a60caa6d 100644
@@ -42,6 +42,7 @@ do_install () {
     do
         # Remove hardcoded relative paths
         sed -i -e 's#..\/utils\/##' ${script}
+        sed -i -e 's#. ..\/Switches#${bindir}#g' ${script}
 
         script_basename=`basename ${script}`
         install -m 0755 $script ${D}${libdir}/${BPN}/${script_basename}
@@ -54,7 +55,7 @@ do_install () {
         # if the script includes any helper scripts from the $libdir
         # directory then change the source path to the absolute path
         # to reflect the install location of the helper scripts.
-        sed -i -e "s#source ../include#source ${libdir}/${BPN}#g" ${script}
+        sed -i -e "s#. ../include#. ${libdir}/${BPN}#g" ${script}
         # Remove hardcoded relative paths
         sed -i -e 's#..\/utils\/##' ${script}
 
Signature · 1 line
2.17.1
#1 lore raw

Thanks Anastasios for contribution sadly it fails to parse

ERROR: /mnt/b/yoe/master/sources/meta-openembedded/meta-oe/recipes-test/pm-qa/pm-qa_git.bb:
Error during parse shell code, the last 5 lines are:

                             | ETA:  --:--:--

        script_basename=`basename ${script}`
        install -m 0755 $script

/mnt/b/yoe/master/build/tmp/work/core2-64-yoe-linux/pm-qa/0.5.2-r0/image/usr/bin/${script_basename}
done

Quoted 46 lines · Anastasios Kavoukis

A commit in the repo of pm-qa:

"adf9df9 Fix path to library files and change shebang line"

Changed the text that sed was using to replace relative to absolute paths.

As a result sed was not effectively finding the text "source ../include" to replace it, as the sed should be now searching for ". ../include".

Similarly for "../Switches"

---
 meta-oe/recipes-test/pm-qa/pm-qa_git.bb | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
meta-oe/recipes-test/pm-qa/pm-qa_git.bb +2 -2
index 7e9971ea4..9a60caa6d 100644
@@ -42,6 +42,7 @@ do_install () {
     do
         # Remove hardcoded relative paths
         sed -i -e 's#..\/utils\/##' ${script}
+        sed -i -e 's#. ..\/Switches#${bindir}#g" ${script}
 
         script_basename=`basename ${script}`
         install -m 0755 $script ${D}${libdir}/${BPN}/${script_basename}
@@ -54,7 +55,7 @@ do_install () {
         # if the script includes any helper scripts from the $libdir
         # directory then change the source path to the absolute path
         # to reflect the install location of the helper scripts.
-        sed -i -e "s#source ../include#source ${libdir}/${BPN}#g" ${script}
+        sed -i -e "s#. ../include#. ${libdir}/${BPN}#g" ${script}
         # Remove hardcoded relative paths
         sed -i -e 's#..\/utils\/##' ${script}
 
--

2.17.1