[Acked] [kteam-tools][PATCHv2] apply-stable-patches: add --stop-on-fail switch
Andy Whitcroft
apw at canonical.com
Mon Sep 23 09:20:10 UTC 2013
On Fri, Sep 20, 2013 at 01:33:04PM -0700, Kamal Mostafa wrote:
> 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)
Looks reasonable thing to be able to do. I assume you are testing it
:).
Acked-by: Andy Whitcroft <apw at canonical.com>
-apw
More information about the kernel-team
mailing list