summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNico Huber <nico.h@gmx.de>2016-07-27 00:28:03 +0200
committerMartin Roth <martinroth@google.com>2016-07-31 17:37:41 +0200
commit4b48ed8f387e846e647250b93e3915b06b123d45 (patch)
tree93d0ba9288a129bb9f5430b2962e566feca37e12
parent828e73e0b69896c769e2b9baf6a22c22eafd3734 (diff)
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)
-rwxr-xr-xutil/crossgcc/buildgcc2
1 files changed, 1 insertions, 1 deletions
diff --git a/util/crossgcc/buildgcc b/util/crossgcc/buildgcc
index 49f6f4cc10..3f5f562adc 100755
--- a/util/crossgcc/buildgcc
+++ b/util/crossgcc/buildgcc
@@ -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
}