diff mbox series

[meta-filesystems] e2tools: join lines in generated file to fix buildpaths errors

Message ID 20251222101855.115501-1-yoann.congal@smile.fr
State New
Headers show
Series [meta-filesystems] e2tools: join lines in generated file to fix buildpaths errors | expand

Commit Message

Yoann Congal Dec. 22, 2025, 10:18 a.m. UTC
From: Yoann Congal <yoann.congal@smile.fr>

The generated file "config.status" contains WORKDIR paths in strings
literal split across multiple lines, like:
  S["foo"]="/path/to/work"\
  "dir/"
These line splits prevent the usual sed from working properly.
Make a first pass on the file to undo any line split.

Fixes this error (that may happen depending on TOPDIR path length):
  ERROR: e2tools-0.1.2-r0 do_package_qa: QA Issue: File /usr/lib/e2tools/ptest/build/config.status in package e2tools-ptest contains reference to TMPDIR [buildpaths]
Seen on AB: https://autobuilder.yoctoproject.org/valkyrie/#/builders/87/builds/79/steps/13/logs/stdio

Signed-off-by: Yoann Congal <yoann.congal@smile.fr>
---
 .../recipes-utils/e2tools/e2tools_0.1.2.bb         | 14 ++++++++++++++
 1 file changed, 14 insertions(+)
diff mbox series

Patch

diff --git a/meta-filesystems/recipes-utils/e2tools/e2tools_0.1.2.bb b/meta-filesystems/recipes-utils/e2tools/e2tools_0.1.2.bb
index b7b925da0e..c9631f6219 100644
--- a/meta-filesystems/recipes-utils/e2tools/e2tools_0.1.2.bb
+++ b/meta-filesystems/recipes-utils/e2tools/e2tools_0.1.2.bb
@@ -39,6 +39,20 @@  do_install_ptest() {
         ${D}${PTEST_PATH}/build/autom4te.cache \
         ${D}${PTEST_PATH}/*/*/.git ${D}${PTEST_PATH}/*/*/.github \
         ${D}${PTEST_PATH}/*/*/autom4te.cache
+
+    # config.status contains WORKDIR paths in strings literal split across
+    # multiple lines. ie
+    # S["foo"]="/path/to/work"\
+    # "dir/"
+    # These line splits prevent the following sed from working properly.
+    # Make a first pass on the file to undo any line split
+    sed '
+        :a;N;$!ba;  # Read the whole file into the pattern buffer
+        s/"\\\n"//g # Delete "\<newline>" ie literal string line break
+        ' \
+        -i ${D}${PTEST_PATH}/build/config.status
+
+    # Now remove/replace the non-reproducible paths
     sed -e 's@[^ ]*-ffile-prefix-map=[^ "]*@@g' \
         -e 's@[^ ]*-fdebug-prefix-map=[^ "]*@@g' \
         -e 's@[^ ]*-fmacro-prefix-map=[^ "]*@@g' \