[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Quilt-dev] [PATCH] push: patch's --merge option has an optional arg
From: |
Jean Delvare |
Subject: |
Re: [Quilt-dev] [PATCH] push: patch's --merge option has an optional argument now |
Date: |
Mon, 25 Jan 2010 11:28:44 +0100 |
User-agent: |
KMail/1.9.1 |
Hi Bert,
Le samedi 2 janvier 2010 13:33, Bert Wesarg a écrit :
> Since version 2.6.1 the patch utility knows an optional argument for
> --merge. Regognize this and pass it on to patch.
>
> Signed-off-by: Bert Wesarg <address@hidden>
>
> ---
> quilt/push.in | 21 +++++++++++++++------
> 1 files changed, 15 insertions(+), 6 deletions(-)
>
> diff --git a/quilt/push.in b/quilt/push.in
> index d89f927..66980c6 100644
> --- a/quilt/push.in
> +++ b/quilt/push.in
> @@ -21,7 +21,7 @@ setup_colors
>
> usage()
> {
> - printf $"Usage: quilt push [-afqv] [--merge] [--leave-rejects]
> [--color[=always|auto|never]] [num|patch]\n"
> + printf $"Usage: quilt push [-afqv] [--merge[=merge|diff3]]
> [--leave-rejects] [--color[=always|auto|never]] [num|patch]\n"
> if [ x$1 = x-h ]
> then
> printf $"
> @@ -44,7 +44,7 @@ be used.
> --fuzz=N
> Set the maximum fuzz factor (default: 2).
>
> --m, --merge
> +-m, --merge[=merge|diff3]
> Merge the patch file into the original files (see patch(1)).
>
> --leave-rejects
> @@ -274,7 +274,7 @@ list_patches()
> fi
> }
>
> -options=`getopt -o fqvamh --long fuzz:,merge,leave-rejects,color:: -- "$@"`
> +options=`getopt -o fqvamh --long fuzz:,merge::,leave-rejects,color:: -- "$@"`
Shouldn't "-o fqvamh" become "-o fqvam::h"?
>
> if [ $? -ne 0 ]
> then
> @@ -305,8 +305,17 @@ do
> opt_fuzz=$2
> shift 2 ;;
> -m | --merge)
> - opt_merge=1
> - shift 1 ;;
> + case "$2" in
> + "" | merge)
> + opt_merge=1
> + opt_merge_arg= ;;
> + diff3)
> + opt_merge=1
> + opt_merge_arg="=diff3" ;;
> + *)
> + usage ;;
> + esac
> + shift 2 ;;
Is "shift 2" really OK if the optional argument wasn't provided?
> --leave-rejects)
> opt_leave_rejects=1
> shift ;;
> @@ -357,7 +366,7 @@ more_patch_args=
> more_patch_args="$more_patch_args -f"
> if [ -n "$opt_merge" ]
> then
> - more_patch_args="$more_patch_args --merge"
> + more_patch_args="$more_patch_args --merge$opt_merge_arg"
> fi
> [ -n "$opt_fuzz" ] && more_patch_args="$more_patch_args -F$opt_fuzz"
>
Other than that, it looks good and I think we should apply this
patch once fixed.
--
Jean Delvare
Suse L3