]> code.ossystems Code Review - openembedded-core.git/commitdiff
distutils: regenerate pyc files after being modified by sed
authorAlejandro Hernandez <alejandro.hernandez@linux.intel.com>
Thu, 11 Jun 2015 15:38:54 +0000 (15:38 +0000)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Sun, 28 Jun 2015 08:42:02 +0000 (09:42 +0100)
py files are edited by sed and therefore *.pyc files are recreated on first boot, but if you have a read-only filesystem this is not possible. This patch creates pyc files directly after the py files are modified.

[YOCTO #7722]

(From OE-Core rev: a0460ac8a2595d4b064b483ca1f282a255ae6411)

Signed-off-by: Alejandro Hernandez <alejandro.hernandez@linux.intel.com>
Signed-off-by: Thomas Roos <roosesweb@gmail.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/classes/distutils.bbclass

index 6ed7ecc99ffd1c173df98a6c0a0c952cd5259c37..f100b664e82b4459a5170aef1d6cc9dabb363ae6 100644 (file)
@@ -42,8 +42,8 @@ distutils_do_install() {
         bbfatal "${PYTHON_PN} setup.py install execution failed."
 
         # support filenames with *spaces*
-        # only modify file if it contains path to avoid recompilation on the target
-        find ${D} -name "*.py" -exec grep -q ${D} {} \; -exec sed -i -e s:${D}::g {} \;
+        # only modify file if it contains path  and recompile it
+        find ${D} -name "*.py" -exec grep -q ${D} {} \; -exec sed -i -e s:${D}::g {} \; -exec ${STAGING_BINDIR_NATIVE}/python-native/python -mcompileall {} \;
 
         if test -e ${D}${bindir} ; then        
             for i in ${D}${bindir}/* ; do \