@@ -5,4 +5,5 @@
#
# Include this class when you don't care what version of SPDX you get; it will
# be updated to the latest stable version that is supported
-inherit create-spdx-3.0
+SPDX_CLASS ??= "create-spdx-3.0"
+inherit ${SPDX_CLASS}
@@ -24,8 +24,7 @@ class SPDX22Check(OESelftestTestCase):
def check_recipe_spdx(self, high_level_dir, spdx_file, target_name):
config = textwrap.dedent(
"""\
- INHERIT:remove = "create-spdx"
- INHERIT += "create-spdx-2.2"
+ SPDX_CLASS = "create-spdx-2.2"
"""
)
self.write_config(config)
@@ -89,8 +88,7 @@ class SPDX3CheckBase(object):
config = (
textwrap.dedent(
f"""\
- INHERIT:remove = "create-spdx"
- INHERIT += "{self.SPDX_CLASS}"
+ SPDX_CLASS = "create-spdx-3.0"
"""
)
+ textwrap.dedent(extraconf)
@@ -138,8 +136,6 @@ class SPDX3CheckBase(object):
class SPDX30Check(SPDX3CheckBase, OESelftestTestCase):
- SPDX_CLASS = "create-spdx-3.0"
-
def test_base_files(self):
self.check_recipe_spdx(
"base-files",
In order to inherit SPDX class conditionally, using variable ${SPDX_CLASS} to inherit SPDX class other than original 'INHERIT:remove = "create-spdx"' and INHERIT += "create-spdx-2.2" Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> --- meta/classes/create-spdx.bbclass | 3 ++- meta/lib/oeqa/selftest/cases/spdx.py | 8 ++------ 2 files changed, 4 insertions(+), 7 deletions(-)