[OE-core] [PATCH] distutils.bbclass: only modify *.py file if it contains path to be removed

Christopher Larson clarson at kergoth.com
Sat May 3 01:36:52 UTC 2014


On Fri, May 2, 2014 at 2:00 AM, Radek Dostal <
radek.dostal at streamunlimited.com> wrote:

> -            sed -i -e s:${D}::g "$i"
> +            # only modify file if it contains path to avoid recompilation
> on the target
> +            if (grep "${D}" "$i") >/dev/null 2>&1


If you're to go this route, I'd suggest:

    if grep -q "${D}" "$i"; then

Avoids the unnecessary re-directions, and unnecessary sub-shell.
-- 
Christopher Larson
clarson at kergoth dot com
Founder - BitBake, OpenEmbedded, OpenZaurus
Maintainer - Tslib
Senior Software Engineer, Mentor Graphics
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openembedded.org/pipermail/openembedded-core/attachments/20140502/7c5fa986/attachment-0002.html>


More information about the Openembedded-core mailing list