UPSTREAM: 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.

BUG=None
BRANCH=None
TEST=None

Change-Id: I090caacc0e3eed4bd993717368a7f0afc0622bb1
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)
Reviewed-on: https://chromium-review.googlesource.com/366217
Commit-Ready: Furquan Shaikh <furquan@chromium.org>
Tested-by: Furquan Shaikh <furquan@chromium.org>
Reviewed-by: Furquan Shaikh <furquan@chromium.org>
This commit is contained in:
Nico Huber 2016-07-27 00:28:03 +02:00 committed by chrome-bot
parent 5d615ee833
commit e138223d87

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
}