diff options
author | Radek Dostal <radek.dostal@streamunlimited.com> | 2014-05-05 09:38:22 +0200 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2014-05-08 12:56:40 +0100 |
commit | 2d01c5a4989dcf03a202c27730a2a8f334e0c37a (patch) | |
tree | 38b7689e69fb3b5371f54d15bda4ce3ff7e1f0b0 /meta/classes/distutils.bbclass | |
parent | 337798fa5c0a1d1e745a143f6a9f398b07f0628f (diff) | |
download | openembedded-core-2d01c5a4989dcf03a202c27730a2a8f334e0c37a.tar.gz openembedded-core-2d01c5a4989dcf03a202c27730a2a8f334e0c37a.tar.bz2 openembedded-core-2d01c5a4989dcf03a202c27730a2a8f334e0c37a.zip |
distutils.bbclass: only modify *.py file if it contains path to be removed
Currently sed command touches every single *.py file. This modifies the
timestamp of the file. All *.pyo files will be recompiled during the first
boot, because timestamp will not match. This should be only necessary if
sed command changes the file.
Signed-off-by: Radek Dostal <radek.dostal@streamunlimited.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Diffstat (limited to 'meta/classes/distutils.bbclass')
-rw-r--r-- | meta/classes/distutils.bbclass | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/meta/classes/distutils.bbclass b/meta/classes/distutils.bbclass index f3da023942..12f26036fa 100644 --- a/meta/classes/distutils.bbclass +++ b/meta/classes/distutils.bbclass @@ -43,7 +43,10 @@ distutils_do_install() { # support filenames with *spaces* find ${D} -name "*.py" -print0 | while read -d $'\0' i ; do \ - sed -i -e s:${D}::g "$i" + # only modify file if it contains path to avoid recompilation on the target + if grep -q "${D}" "$i"; then + sed -i -e s:${D}::g "$i" + fi done if test -e ${D}${bindir} ; then |