diff mbox series

[poky,1/1] setuptools3: adding sanity check to detect python-eggs install

Message ID 6079e5a15a635a639338c76873c41c2a69f72774.1680070372.git.loc.nguyen.wt@renesas.com
State New
Headers show
Series [poky,1/1] setuptools3: adding sanity check to detect python-eggs install | expand

Commit Message

loc.renesas@gmail.com March 29, 2023, 8:08 a.m. UTC
From: Loc Nguyen <loc.nguyen.wt@renesas.com>

Packages that install Python modules shouldn't be installing Eggs,
as distro-managed modules should be "bare"

Added a sanity check to verify if python modules will install Eggs.
If yes, display a warning message to user.

See [YOCTO #5725] for more details

Signed-off-by: Loc Nguyen <loc.nguyen.wt@renesas.com>
---
 meta/classes-recipe/setuptools3.bbclass | 10 ++++++++++
 1 file changed, 10 insertions(+)
diff mbox series

Patch

diff --git a/meta/classes-recipe/setuptools3.bbclass b/meta/classes-recipe/setuptools3.bbclass
index 4c6e79ee9a..1ce470f7e3 100644
--- a/meta/classes-recipe/setuptools3.bbclass
+++ b/meta/classes-recipe/setuptools3.bbclass
@@ -33,6 +33,16 @@  setuptools3_do_install() {
         python_pep517_do_install
 }
 
+python do_sanity_check() {
+    # Python modules shouldn't be installing Eggs, as distro-managed modules should be "bare"
+    pkgName = d.getVar('BPN')
+    rdeps = d.getVar('RDEPENDS_' + pkgName) or ""
+    if ('python-eggs' in rdeps) or ('python3-eggs' in rdeps):
+        bb.warn(pkgName + ' is installing Eggs.')
+}
+
+addtask sanity_check before do_fetch
+
 EXPORT_FUNCTIONS do_configure do_compile do_install
 
 export LDSHARED="${CCLD} -shared"