These are only used with python when the -O or -OO options are passed
and I'm not aware of runtime use of that. They otherwise just waste a
ton of space.

Signed-off-by: Richard Purdie <[email protected]>
---
 meta/recipes-devtools/python/python3_3.10.2.bb | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/meta/recipes-devtools/python/python3_3.10.2.bb 
b/meta/recipes-devtools/python/python3_3.10.2.bb
index 7ec443a531f..97e74ceb688 100644
--- a/meta/recipes-devtools/python/python3_3.10.2.bb
+++ b/meta/recipes-devtools/python/python3_3.10.2.bb
@@ -189,6 +189,11 @@ do_install:append() {
         # More info: http://benno.id.au/blog/2013/01/15/python-determinism
         rm 
${D}${libdir}/python${PYTHON_MAJMIN}/test/__pycache__/test_range.cpython*
         rm 
${D}${libdir}/python${PYTHON_MAJMIN}/test/__pycache__/test_xml_etree.cpython*
+
+        # Remove the opt-1.pyc and opt-2.pyc files. They effectively waste 
space on embedded
+        # style targets as they're only used when python is called with the -O 
or -OO options
+        # which is rare.
+        find ${D} -name *opt-*.pyc -delete
 }
 
 do_install:append:class-nativesdk () {
-- 
2.32.0

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#162664): 
https://lists.openembedded.org/g/openembedded-core/message/162664
Mute This Topic: https://lists.openembedded.org/mt/89528766/21656
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to