diff options
authorThomas Petazzoni <>2017-06-24 19:59:36 (GMT)
committerArnout Vandecappelle (Essensium/Mind) <>2017-09-19 20:51:25 (GMT)
commit85f11d08c387c200dbb59a8559f2ba62376689bf (patch)
parentb55ff5a7cdaa8a45101d11a3c095d9aeab1f0ce4 (diff)
support/scripts/ do not apply patches with renamesHEADmaster
Patches with renames apply properly with patch >= 2.7, but not with older patch versions. Since "git format-patch" by default generates patches with renames, Buildroot developers often don't realize that their patches will not apply properly on build machines that have patch < 2.7. In order to prevent such a situation from happening again, this commit adds some logic in to refuse applying patches that contain renames. Note that just searching for '^rename' is not sufficient, since the patch commit message may contain the words "rename from" or "rename to" as well. Therefore, the grep expression is made as accurate as possible, checking both. Signed-off-by: Thomas Petazzoni <> Reviewed-by: Arnout Vandecappelle (Essensium/Mind) <> Reviewed-by: "Yann E. MORIN" <> [Arnout: spaces instead of tabs (suggested by Yann); extend commit message.] Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <>
1 files changed, 5 insertions, 0 deletions
diff --git a/support/scripts/ b/support/scripts/
index 7ccb39d..66fef26 100755
--- a/support/scripts/
+++ b/support/scripts/
@@ -113,6 +113,11 @@ function apply_patch {
echo " to be applied : ${path}/${patch}"
exit 1
+ if grep -q "^rename from" ${path}/${patch} && \
+ grep -q "^rename to" ${path}/${patch} ; then
+ echo "Error: patch contains some renames, not supported by old patch versions"
+ exit 1
+ fi
echo "${path}/${patch}" >> ${builddir}/.applied_patches_list
${uncomp} "${path}/$patch" | patch -g0 -p1 -E -d "${builddir}" -t -N $silent
if [ $? != 0 ] ; then