quilt-dev
[Top][All Lists]
Advanced

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

Re: [Quilt-dev] Rename patch?


From: Andreas Gruenbacher
Subject: Re: [Quilt-dev] Rename patch?
Date: Mon, 18 Apr 2005 21:11:37 +0200
User-agent: KMail/1.8

On Sunday 17 April 2005 21:05, Jean Delvare wrote:
> [Jean Delvare]
>
> > I would like to rename a patch which is in a quilt series. "quilt
> > rename" doesn't seem to exist. I searched the web and could only
> > find one reference, which is an older thread on this list:
> >   http://lists.gnu.org/archive/html/quilt-dev/2003-07/msg00002.html
>
> [Baruch Even]
>
> > To rename a patch simply rename the patch and do the same in the
> > series file.
>
> Additionally, as the patch was applied, I would have had to rename the
> corresponding directory in .pc, and update .pc/applied-patches. In other
> words...
>
> > Alternatively, add the quilt rename command to quilt and submit the
> > patch :-) it should do just what the above line says, should be
> > pretty simple.
>
> ...a script would make the job easier, indeed.
>
> I took my chance on it. Unsurprisingly, it ends up as a simplified
> version of the fork patch. Differences:
> 1* Rename can operate on any patch, not only the topmost one. This
> includes unapplied patches.
> 2* The new name must be provided, it is never guessed.
> 3* Of course, the patch file is renamed instead of being duplicated.

Can we unify fork and rename? I'm thinking of one script for both that checks 
under which name it was called. The functionality of the two should be _very_ 
close, the only difference being that fork copies the patch file, while 
rename moves it.

> Point #2 could be modified if needed. Not sure it, but since the fork
> command has it, maybe it is after all.
>
> I think I now understand the point of the fork command, but still
> believe that it should be better documented.

Documentation improvements are just as welcome as code improvements ;)

> My rename script is attached. Works just fine for me. If it receives
> positive feedback, I will provide a clean patch against quilt CVS.

Sorry I won't look at it right now; not enough time :(

> Kudos to the developers of quilt, this quick hack was really easy, even
> without a strong background of shell scripting. The code structure is
> very clean.

Thanks. A part of the credits go to Andrew Morton, who wrote quilt's 
predecessor ;)

> There are two things I left in because the fork script had them, but
> don't fully understand. Hints would be appreciated.
>
> new_patch=${1#$QUILT_PATCHES/}
>
> Why is the prefix stripping needed here?

The user may have specified a path relative to $QUILT_PATCHES/ (as when using 
tab completion). We always allow this, and strip off this prefix.

>    ( [ -e "$(patch_file_name $patch)" ] && \
>      ! mv "$(patch_file_name $patch)" \
>         "$(patch_file_name $new_patch)" )
>
> I don't quite see how $patch could not exist, since we previously
> checked that it was in the series. Or is it really only an integrity
> check?

The patch may exist in the series file and in .pc/, but not in patches/; 
that's a valid state: the actual patch file doesn't exist before ``quilt 
refresh'' is run.

Thanks for looking into this!

Cheers,
-- 
Andreas Gruenbacher <address@hidden>
SUSE Labs, SUSE LINUX PRODUCTS GMBH




reply via email to

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