]> code.ossystems Code Review - openembedded-core.git/commitdiff
python3: Drop opt1 and opt2 pyc files from target
authorRichard Purdie <richard.purdie@linuxfoundation.org>
Thu, 3 Mar 2022 16:33:40 +0000 (16:33 +0000)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Fri, 4 Mar 2022 17:13:10 +0000 (17:13 +0000)
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 <richard.purdie@linuxfoundation.org>
meta/recipes-devtools/python/python3_3.10.2.bb

index 41b7b92b343e8e2420b55aaf885aa4afbb655762..e61b23c6a9b7f02c8ca65f2b617de36c8b0e9538 100644 (file)
@@ -189,6 +189,11 @@ do_install:append() {
         # More info: http://benno.id.au/blog/2013/01/15/python-determinism
         rm -f ${D}${libdir}/python${PYTHON_MAJMIN}/test/__pycache__/test_range.cpython*
         rm -f ${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 () {