From ab3b84370b0cb0e8b6eedb6359d3ffb81c1348c9 Mon Sep 17 00:00:00 2001 From: Lucien Mueller Date: Wed, 12 Dec 2018 16:28:36 +0100 Subject: [PATCH] python3: Removes pycache. INCLUDE_PYC = 0 should prevent the python recipe to build pycache. Because it still produces half the pycache (bug?), I added a script to find and remove all pycache directories before they are packaged. BugzID: 53805 Signed-off-by: Lucien Mueller --- recipes-devtools/python/python3_%.bbappend | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/recipes-devtools/python/python3_%.bbappend b/recipes-devtools/python/python3_%.bbappend index d52f18d..54c986e 100644 --- a/recipes-devtools/python/python3_%.bbappend +++ b/recipes-devtools/python/python3_%.bbappend @@ -1 +1,9 @@ EXTRA_OECONF_remove = "ac_cv_header_bluetooth_bluetooth_h=no ac_cv_header_bluetooth_h=no" + +INCLUDE_PYCS = "0" + +PACKAGE_PREPROCESS_FUNCS += "clean_pycache" + +clean_pycache(){ + find ${PKGD} | grep -E "(__pycache__|\.pyc|\.pyo$)" | xargs rm -rf +}