[kteam-tools][PATCHv2] apply-stable-patches: add --stop-on-fail switch
Kamal Mostafa
kamal at canonical.com
Fri Sep 20 20:33:04 UTC 2013
This PATCHv2 uses spaces not tabs for consistency (thanks apw).
-Kamal
-------------------- >8 --------------------
If --stop-on-fail is set, stop processing if a patch fails to apply.
Signed-off-by: Kamal Mostafa <kamal at canonical.com>
---
stable/apply-stable-patches | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/stable/apply-stable-patches b/stable/apply-stable-patches
index d25a3b3..ccceec8 100755
--- a/stable/apply-stable-patches
+++ b/stable/apply-stable-patches
@@ -79,6 +79,8 @@ class Cmdline:
--check-already Check for already committed ('commit {sha} upstream.')
patches
+ --stop-on-fail Stop processing if a patch fails to apply
+
--name=<full name>
Name to use for the SOB line.
Default is git config user.name
@@ -116,7 +118,8 @@ class Cmdline:
try:
optsShort = ''
optsLong = ['help', 'range=', 'sob', 'verbose', 'config=',
- 'check-already', 'debug=', 'name=', 'email=']
+ 'check-already', 'stop-on-fail', 'debug=',
+ 'name=', 'email=']
opts, args = getopt(argv[1:], optsShort, optsLong)
for opt, val in opts:
@@ -132,6 +135,9 @@ class Cmdline:
elif (opt == '--check-already'):
self.cfg['check_already'] = True
+ elif (opt == '--stop-on-fail'):
+ self.cfg['stop_on_fail'] = True
+
elif opt in ('--name'):
self.cfg['name'] = val
@@ -515,6 +521,9 @@ class ApplyStablePatches(StdApp):
move(patch_file, failed_dir)
print("failed")
status, result = run_command('git am --abort')
+ if 'stop_on_fail' in self.cfg:
+ print("Stopping because a patch failed to apply.")
+ break
continue
if patch_file == filename:
move(filename, applied_dir)
--
1.8.1.2
More information about the kernel-team
mailing list