]> code.ossystems Code Review - openembedded-core.git/commitdiff
distutils.bbclass: only modify *.py file if it contains path to be removed
authorRadek Dostal <radek.dostal@streamunlimited.com>
Mon, 5 May 2014 07:38:22 +0000 (09:38 +0200)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Thu, 8 May 2014 11:56:40 +0000 (12:56 +0100)
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>
meta/classes/distutils.bbclass

index f3da023942e5b9964877b4290652d8fb58a8f8dc..12f26036fa5cbd1441fe16b797bc919b147b7b53 100644 (file)
@@ -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