[oe-commits] Alejandro Hernandez : distutils: regenerate pyc files after being modified by sed

git at git.openembedded.org git at git.openembedded.org
Tue Jun 23 10:55:07 UTC 2015


Module: openembedded-core.git
Branch: master
Commit: a0460ac8a2595d4b064b483ca1f282a255ae6411
URL:    http://git.openembedded.org/?p=openembedded-core.git&a=commit;h=a0460ac8a2595d4b064b483ca1f282a255ae6411

Author: Alejandro Hernandez <alejandro.hernandez at linux.intel.com>
Date:   Thu Jun 11 15:38:54 2015 +0000

distutils: regenerate pyc files after being modified by sed

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]

Signed-off-by: Alejandro Hernandez <alejandro.hernandez at linux.intel.com>
Signed-off-by: Thomas Roos <roosesweb at gmail.com>
Signed-off-by: Ross Burton <ross.burton at intel.com>

---

 meta/classes/distutils.bbclass | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/meta/classes/distutils.bbclass b/meta/classes/distutils.bbclass
index c0bb573..2498685 100644
--- a/meta/classes/distutils.bbclass
+++ b/meta/classes/distutils.bbclass
@@ -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 \



More information about the Openembedded-commits mailing list