Skip to content

Commit 531853f

Browse files
committed
Stop building if patching fails
Patching may fail without the presence of the "FAILED" word in the output (i.e., if a path referenced in a patch does not exist). If the patch does not apply successfully, for whatever reason, stops the build. Bug: 174302848 Test: build.py Change-Id: Ic92368e443cfbf6a22aa8009a8ffea1db3621d2e
1 parent ee6a38f commit 531853f

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

build.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -100,10 +100,7 @@ def main():
100100
print("Applying patch: " + filename)
101101
print(out)
102102

103-
# Check for the presence of FAILED as the error code is the same
104-
# for a failed patch and an already-applied patch. This makes it
105-
# less painful for developers.
106-
if 'FAILED' in out and not args.no_patch_abort:
103+
if p.returncode != 0 and not args.no_patch_abort:
107104
print("Build failed when applying patch {}"
108105
.format(filename))
109106
print("If developing locally, try the --no-patch-abort flag")

0 commit comments

Comments
 (0)