diff mbox series

[kirkstone,17/30] recipetool: Fix inherit in created -native* recipes

Message ID 30c0469c57bd0c57ad4a3d0e8306defc8192d3d3.1690739937.git.steve@sakoman.com
State Accepted, archived
Commit 2c92780236b25205af0dcf75de2d2ede14132152
Headers show
Series [kirkstone,01/30] libjpeg-turbo: patch CVE-2023-2804 | expand

Commit Message

Steve Sakoman July 30, 2023, 6 p.m. UTC
From: Yoann Congal <yoann.congal@smile.fr>

native and nativesdk classes are special and must be inherited last :
put them at the end of the gathered classes to inherit.

Signed-off-by: Yoann Congal <yoann.congal@smile.fr>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit a6614fd800cbe791264aeb102d379ba79bd145c2)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
---
 scripts/lib/recipetool/create.py | 4 ++++
 1 file changed, 4 insertions(+)
diff mbox series

Patch

diff --git a/scripts/lib/recipetool/create.py b/scripts/lib/recipetool/create.py
index 220465ed2f..67894fb4d0 100644
--- a/scripts/lib/recipetool/create.py
+++ b/scripts/lib/recipetool/create.py
@@ -745,6 +745,10 @@  def create_recipe(args):
     for handler in handlers:
         handler.process(srctree_use, classes, lines_before, lines_after, handled, extravalues)
 
+    # native and nativesdk classes are special and must be inherited last
+    # If present, put them at the end of the classes list
+    classes.sort(key=lambda c: c in ("native", "nativesdk"))
+
     extrafiles = extravalues.pop('extrafiles', {})
     extra_pn = extravalues.pop('PN', None)
     extra_pv = extravalues.pop('PV', None)