quilt-dev
[Top][All Lists]
Advanced

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

Re: [Quilt-dev] Rename patch?


From: Jean Delvare
Subject: Re: [Quilt-dev] Rename patch?
Date: Sun, 17 Apr 2005 21:05:14 +0200

[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.

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.

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

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.

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?

   ( [ -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?

Thanks,
-- 
Jean Delvare

Attachment: rename
Description: Text document


reply via email to

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