Skip to contentSkip to conversation

lib/oe/package_managegment: Add nativesdk-intercept PATH

PATCH In review Eilís 'pidge' Ní Fhlannagáin 1 participant 1 message Sep 14, 2023

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 lib/oe/package_managegment: Add nativesdk-intercept PATH

[YOCTO #15023]

This patch adds (and removes after function execution) the nativesdk-intercept/chown|chgrp PATH before target_pm.run_intercepts calls during populate_sdk builds.

This has been tested with cleanall builds and testsdk and fails on deb due to an issue where $D${localstatedir}/cache/man/ does not exist for some reason. I've a work around for that in the next patch in this series.

---
 meta/lib/oe/package_manager/deb/sdk.py | 5 +++++
 meta/lib/oe/package_manager/ipk/sdk.py | 5 +++++
 meta/lib/oe/package_manager/rpm/sdk.py | 5 +++++
 3 files changed, 15 insertions(+)
meta/lib/oe/package_manager/deb/sdk.py +5 -0
index 653e42ab3c0..6f3005053eb 100644
@@ -69,7 +69,12 @@ class PkgSdk(Sdk):
 
         self.target_pm.run_pre_post_installs()
 
+        env_bkp = os.environ.copy()
+        os.environ['PATH'] = self.d.expand("${COREBASE}/scripts/nativesdk-intercept") + \
+                             os.pathsep + os.environ["PATH"]
+
         self.target_pm.run_intercepts(populate_sdk='target')
+        os.environ.update(env_bkp)
 
         execute_pre_post_process(self.d, self.d.getVar("POPULATE_SDK_POST_TARGET_COMMAND"))
 
meta/lib/oe/package_manager/ipk/sdk.py +5 -0
index 6a1f167fb77..cc7a7ede547 100644
@@ -63,7 +63,12 @@ class PkgSdk(Sdk):
 
         self.target_pm.install_complementary(self.d.getVar('SDKIMAGE_INSTALL_COMPLEMENTARY'))
 
+        env_bkp = os.environ.copy()
+        os.environ['PATH'] = self.d.expand("${COREBASE}/scripts/nativesdk-intercept") + \
+                             os.pathsep + os.environ["PATH"]
+
         self.target_pm.run_intercepts(populate_sdk='target')
+        os.environ.update(env_bkp)
 
         execute_pre_post_process(self.d, self.d.getVar("POPULATE_SDK_POST_TARGET_COMMAND"))
 
meta/lib/oe/package_manager/rpm/sdk.py +5 -0
index 85df6e949cc..ea79fe050bc 100644
@@ -67,7 +67,12 @@ class PkgSdk(Sdk):
 
         self.target_pm.install_complementary(self.d.getVar('SDKIMAGE_INSTALL_COMPLEMENTARY'))
 
+        env_bkp = os.environ.copy()
+        os.environ['PATH'] = self.d.expand("${COREBASE}/scripts/nativesdk-intercept") + \
+                             os.pathsep + os.environ["PATH"]
+
         self.target_pm.run_intercepts(populate_sdk='target')
+        os.environ.update(env_bkp)
 
         execute_pre_post_process(self.d, self.d.getVar("POPULATE_SDK_POST_TARGET_COMMAND"))
 
Signature · 1 line
2.34.1