[2/2] meta/classes/testexport: Remove __pycache__ from exported tests

Submitted by Aníbal Limón on Oct. 17, 2018, 11 p.m. | Patch ID: 155759

Details

Message ID 20181017230044.24098-2-anibal.limon@linaro.org
State Master Next
Commit 22d74604795babbee115e55387620f3a58bd98b0
Headers show

Commit Message

Aníbal Limón Oct. 17, 2018, 11 p.m.
The __pycache__ is created based on python3 version in the build machine
and isn't a garantee to be useful on the system that runs exported tests.

Signed-off-by: Aníbal Limón <anibal.limon@linaro.org>
---
 meta/classes/testexport.bbclass | 5 +++++
 1 file changed, 5 insertions(+)

Patch hide | download patch | download mbox

diff --git a/meta/classes/testexport.bbclass b/meta/classes/testexport.bbclass
index 8b01504d3a..f38d093e81 100644
--- a/meta/classes/testexport.bbclass
+++ b/meta/classes/testexport.bbclass
@@ -131,6 +131,11 @@  def copy_needed_files(d, tc):
     shutil.copy2(image_manifest, os.path.join(test_data_path, os.path.basename(image_manifest)))
     shutil.copy2(tdname, os.path.join(test_data_path, os.path.basename(tdname)))
 
+    for subdir, dirs, files in os.walk(export_path):
+        for dir in dirs:
+            if dir == '__pycache__':
+                shutil.rmtree(os.path.join(subdir, dir))
+
     # Create tar file for common parts of testexport
     create_tarball(d, "testexport.tar.gz", d.getVar("TEST_EXPORT_DIR"))