Skip to contentSkip to conversation

create-spdx.bbclass: fix patch error for recipes that inherit dos2unix

PATCH In review Ming Liu 2 participants 2 messages Jan 5, 2025 – Jan 6, 2025

lore
Share & tools
lore

Ming Liu

author
#0 lore raw

PATCH 1/1 create-spdx.bbclass: fix patch error for recipes that inherit dos2unix

For the recipes inheriting dos2unix, do_patch will fail if do_convert_crlf_to_lf not run before it.

---
 meta/classes/create-spdx.bbclass | 2 ++
 1 file changed, 2 insertions(+)
meta/classes/create-spdx.bbclass +2 -0
index 349ecfe6ab..26d586744e 100644
@@ -810,6 +810,8 @@ def spdx_get_src(d):
 
         # Make sure gcc and kernel sources are patched only once
         if not (d.getVar('SRC_URI') == "" or is_work_shared_spdx(d)):
+            if bb.data.inherits_class('dos2unix', d):
+                bb.build.exec_func('do_convert_crlf_to_lf', d)
             bb.build.exec_func('do_patch', d)
 
         # Some userland has no source.
Signature · 1 line
2.43.0
#1 lore raw
Quoted 13 lines · Ming Liu via lists.openembedded.org

For the recipes inheriting dos2unix, do_patch will fail if do_convert_crlf_to_lf not run before it.

---
 meta/classes/create-spdx.bbclass | 2 ++

 1 file changed, 2 insertions(+)
meta/classes/create-spdx.bbclass +0 -0
index 349ecfe6ab..26d586744e 100644
@@ -810,6 +810,8 @@ def spdx_get_src(d):
Quoted 9 lines


         # Make sure gcc and kernel sources are patched only once if not (d.getVar('SRC_URI') == "" or is_work_shared_spdx(d)):
+            if bb.data.inherits_class('dos2unix', d):
+                bb.build.exec_func('do_convert_crlf_to_lf', d) bb.build.exec_func('do_patch', d)

         # Some userland has no source.

This is not in master so shouldn't be applied to kirkstone or other branches yet.

I'm also not convinced this is the right fix. We may want to convert do_convert_crlf_to_lf from a separate task to a postfunc for do_unpack or a prefunc for do_patch if it is required it always run at that point.

Cheers,

Richard