patman: Deal with 'git apply' failures correctly
This sort of failure is rare, but the code to deal with it is wrong. Fix it. Signed-off-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
parent
75b3c3aa84
commit
757f64a89b
|
@ -11,6 +11,7 @@ import subprocess
|
||||||
import sys
|
import sys
|
||||||
import terminal
|
import terminal
|
||||||
|
|
||||||
|
import checkpatch
|
||||||
import settings
|
import settings
|
||||||
|
|
||||||
|
|
||||||
|
@ -193,6 +194,7 @@ def ApplyPatch(verbose, fname):
|
||||||
Args:
|
Args:
|
||||||
fname: filename of patch file to apply
|
fname: filename of patch file to apply
|
||||||
"""
|
"""
|
||||||
|
col = terminal.Color()
|
||||||
cmd = ['git', 'am', fname]
|
cmd = ['git', 'am', fname]
|
||||||
pipe = subprocess.Popen(cmd, stdout=subprocess.PIPE,
|
pipe = subprocess.Popen(cmd, stdout=subprocess.PIPE,
|
||||||
stderr=subprocess.PIPE)
|
stderr=subprocess.PIPE)
|
||||||
|
@ -203,8 +205,8 @@ def ApplyPatch(verbose, fname):
|
||||||
print line
|
print line
|
||||||
match = re_error.match(line)
|
match = re_error.match(line)
|
||||||
if match:
|
if match:
|
||||||
print GetWarningMsg('warning', match.group(1), int(match.group(2)),
|
print checkpatch.GetWarningMsg(col, 'warning', match.group(1),
|
||||||
'Patch failed')
|
int(match.group(2)), 'Patch failed')
|
||||||
return pipe.returncode == 0, stdout
|
return pipe.returncode == 0, stdout
|
||||||
|
|
||||||
def ApplyPatches(verbose, args, start_point):
|
def ApplyPatches(verbose, args, start_point):
|
||||||
|
|
Loading…
Reference in New Issue