support/scripts/apply-patches.sh: do not apply patches with renames
authorThomas Petazzoni <thomas.petazzoni@free-electrons.com>
Sat, 24 Jun 2017 19:59:36 +0000 (21:59 +0200)
committerArnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Tue, 19 Sep 2017 20:51:25 +0000 (22:51 +0200)
commit85f11d08c387c200dbb59a8559f2ba62376689bf
tree4d23a07f383a2ea4ed329801bf96d9ea429c16b5
parentb55ff5a7cdaa8a45101d11a3c095d9aeab1f0ce4
support/scripts/apply-patches.sh: do not apply patches with renames

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 apply-patches.sh 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 <thomas.petazzoni@free-electrons.com>
Reviewed-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Reviewed-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
[Arnout: spaces instead of tabs (suggested by Yann);
 extend commit message.]
Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
support/scripts/apply-patches.sh