]> code.ossystems Code Review - openembedded-core.git/commitdiff
distutils/distutils3: Fix bashism
authorRichard Purdie <richard.purdie@linuxfoundation.org>
Fri, 27 Jun 2014 09:23:23 +0000 (10:23 +0100)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Sun, 29 Jun 2014 07:54:21 +0000 (08:54 +0100)
read -d is a bashism. Replace with a direct exec to avoid the problem
in this case. This fixes silent build failures in do_install of
tasks on systems with dash as /bin/sh.

Also merge the fix to distutils for only changing necessary files
to disutils3 as well.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/classes/distutils.bbclass
meta/classes/distutils3.bbclass

index 12f26036fa5cbd1441fe16b797bc919b147b7b53..6ed7ecc99ffd1c173df98a6c0a0c952cd5259c37 100644 (file)
@@ -42,12 +42,8 @@ distutils_do_install() {
         bbfatal "${PYTHON_PN} setup.py install execution failed."
 
         # support filenames with *spaces*
-        find ${D} -name "*.py" -print0 | while read -d $'\0' i ; do \
-            # 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
+        # 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 {} \;
 
         if test -e ${D}${bindir} ; then        
             for i in ${D}${bindir}/* ; do \
index bbd645cc63877f5c0ff5ab2ac15b13030afcbc4a..e909ef41b6629de90181f3f936dd176e9102ee3a 100644 (file)
@@ -64,9 +64,7 @@ distutils3_do_install() {
         bbfatal "${PYTHON_PN} setup.py install execution failed."
 
         # support filenames with *spaces*
-        find ${D} -name "*.py" -print0 | while read -d $'\0' i ; do \
-            sed -i -e s:${D}::g "$i"
-        done
+        find ${D} -name "*.py" -exec grep -q ${D} {} \; -exec sed -i -e s:${D}::g {} \;
 
         if test -e ${D}${bindir} ; then        
             for i in ${D}${bindir}/* ; do \