[Buildroot] [PATCH] support/scripts/apply-patches.sh: do not apply patches with renames

Thomas Petazzoni thomas.petazzoni at free-electrons.com
Fri May 12 15:53:40 UTC 2017


Hello,

On Fri, 12 May 2017 17:40:39 +0200, Yann E. MORIN wrote:

> Meh. path-2.7 was released 5 years ago. Oh well, let's be kind for those
> stuck with ancient entreprise-grade distros... ;-)

Exactly :)


> Oh-oh... Not good:  the '-a' will be passed as an option to grep; this
> is not a [...] construct.
> 
> What you want instead is:
> 
>     if grep -q "^rename from" ${path}/${patch} && \
>        grep -q "^rename to" ${path}/${patch} ; then

OK, will fix.

However, what bothers me with this is that if the patch description
contains "rename from" and "rename to" at the beginning of two lines,
then it will also trigger this condition.

But I'm not sure if it's a really realistic case, and if it ever
happens, we can always fix/improve the script. Unless there is a better
but still simple way to check if a patch uses renames. Ideally we would
want patch >= 2.7 to bail out if there's a rename, but I couldn't find
any option doing this... and this option would anyway not exist with
patch < 2.7.

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com


More information about the buildroot mailing list