buildgcc: Apply patches with -p1

Turned out that there are versions of the patch command that use the
left hand side path for new files created by a patch. This behavior is
incompatible with some of our patches. Stripping the topmost dir from
the path with -p1 helps.

While touching that line, I couldn't resist to drop a command
substituion (the `echo $patch`). It really shouldn't be necessary as the
path to the patch file is already expanded in the head of the for loop.

Change-Id: I95398605db6dd54a8b08d8bc84c6602edbea6e10
Signed-off-by: Nico Huber <nico.h@gmx.de>
Reviewed-on: https://review.coreboot.org/15908
Reviewed-by: Idwer Vollering <vidwer@gmail.com>
Tested-by: build bot (Jenkins)
This commit is contained in:
Nico Huber 2016-07-27 00:28:03 +02:00 committed by Martin Roth
parent 828e73e0b6
commit 4b48ed8f38
1 changed files with 1 additions and 1 deletions

View File

@ -269,7 +269,7 @@ unpack_and_patch() {
for patch in patches/${dir}_*.patch; do
test -r $patch || continue
printf " o $(basename $patch)\n"
$PATCH -s -N -p0 < $(echo $patch) || {
(cd ${dir} && $PATCH -s -N -p1 <../${patch}) || {
printf "\n${RED}Failed $patch.${NC}\n"
exit 1
}