create-spdx.bbclass: fix patch error for recipes that inherit dos2unix
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
@@ -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
Quoted 13 lines · Ming Liu via lists.openembedded.org
For the recipes inheriting dos2unix,
do_patchwill fail ifdo_convert_crlf_to_lfnot run before it.Signed-off-by Ming Liu <[email protected]>---
meta/classes/create-spdx.bbclass | 2 ++1 file changed, 2 insertions(+)meta/classes/create-spdx.bbclass +0
-0@@ -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')== "" oris_work_shared_spdx(d)):
+ ifbb.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