quilt-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Quilt-dev] Bugfixes: "delete" call to "pop" has wrong target; QUIL


From: Joe Green
Subject: Re: [Quilt-dev] Bugfixes: "delete" call to "pop" has wrong target; QUILT_DELETE_ARGS inherited by "pop"
Date: Thu, 08 Sep 2005 17:13:48 -0700
User-agent: Mozilla Thunderbird 1.0.2 (X11/20050317)

Hmm, looks like this didn't go to the list. In case others want to review the patch...

Jean Delvare wrote:
Your analysis and fix look all correct to me. I have always wondered why
"quilt delete" was failing on me, now you've made it clear.

I've applied this first patch to quilt CVS already.

Thanks!

The second patch "quilt-quilt_command.patch" creates a patchfn "quilt_command()" which can be used to invoke subcommands. I think
it would be good to apply this patch as well for consistency in how
subcommands are called.

I fully agree here too.

One question on this patch is whether or not the QUILT_COMMAND
variable should be set so that QUILT_*_ARGS are applied to the
subcommands, or so that only the arguments passed in by the calling
command are applied.  This version does the latter.

Sounds much safer to me the way you did.  The user could have default
options for some commands that make them behave in a non-standard way.

Yes, that was my concern also.

If we ever have a case where picking QUILT_*_ARGS would be useful, we
will have to manually select which options we want.

Yes, I see calling another quilt command internally as an implementation
detail.  If there's an option you'd want to pass on, then logically it
should be an option to the top-level command you're calling as well.

I am willing to apply this second patch as well, unless Andreas (or
anyone) objects.  However, this patch is adding the patchfns inclusion
mechanism to edit.in while that change is already in CVS.  Could you
please resubmit a patch that would apply cleanly on current CVS?

Sure; I figured that change was coming after the discussion yesterday.
The updated patch is attached.

--
Joe Green <address@hidden>
MontaVista Software, Inc.


Source: MontaVista Software, Inc. <address@hidden>
Type: Enhancement
Disposition: submitted to http://savannah.nongnu.org/projects/quilt

Use a standard function "quilt_command" to invoke one quilt command from
another.

Index: quilt-0.42/quilt/delete.in
===================================================================
--- quilt-0.42.orig/quilt/delete.in
+++ quilt-0.42/quilt/delete.in
@@ -112,8 +112,7 @@ else
 fi
 if is_applied $patch
 then
-       if [ "$patch" != "$(top_patch)" ] || \
-          ! QUILT_COMMAND= @BASH@ $BASH_OPTS -c ". @QUILT@/pop" "quilt pop" -fq
+       if [ "$patch" != "$(top_patch)" ] || ! quilt_command pop -fq
        then
                printf $"Patch %s is currently applied\n" \
                       "$(print_patch $patch)" >&2
Index: quilt-0.42/quilt/edit.in
===================================================================
--- quilt-0.42.orig/quilt/edit.in
+++ quilt-0.42/quilt/edit.in
@@ -59,7 +59,7 @@ then
        usage
 fi
 
-bash -c ". @QUILT@/add" "quilt add" "$@"
+quilt_command add "$@"
 status=$?
 if [ $status -ne 0 -a $status -ne 2 ]
 then
@@ -71,7 +71,7 @@ for file in "$@"
 do
        if ! [ -e "$file" ]
        then
-               bash -c ". @QUILT@/remove" "quilt remove" "$file"
+               quilt_command remove "$file"
                status=1
        fi
 done
Index: quilt-0.42/scripts/patchfns.in
===================================================================
--- quilt-0.42.orig/scripts/patchfns.in
+++ quilt-0.42/scripts/patchfns.in
@@ -748,6 +748,14 @@ setup_colors()
        eval $C
 }
 
+quilt_command ()
+{
+       local command=$1
+       shift
+
+       QUILT_COMMAND="" @BASH@ $BASH_OPTS -c ". @QUILT@/$command" "quilt 
$command" "$@"
+}
+
 #
 # If the working directory does not contain a $QUILT_PATCHES directory,
 # quilt searches for its base directory up the directory tree. If no


reply via email to

[Prev in Thread] Current Thread [Next in Thread]