Converting Debian packages from dpatch to quilt
I've been using quilt a lot at work recently (in a non-Debian environment), and I've been enjoying it very much. So much that I've decided to convert my Debian packages to it, from dpatch. Once you're used to quilt, using dpatch is almost literally painful. :)
There doesn't seem to be a ready-made guide on how to convert packages from dpatch to quilt, so here's how to do it painlessly in five easy steps:
- Install the quilt package (duh) and make sure that the
QUILT_PATCHESvariable is set todebian/patchesin your shell environment. Or you can set it in your~/.quiltrcfile instead (see this post for other interesting settings). - Delete the build dependency on
dpatchfrom yourdebian/controlfile, replacing it with a dependency onquilt (>= 0.40). - In your
debian/rulesfile, include/usr/share/quilt/quilt.makeinstead of/usr/share/dpatch/dpatch.make. - Convert all your dpatch files by using the following command from your
package's top level:
for p in $(dpatch list-all); do quilt import -P $p.diff debian/patches/$p.dpatch; quilt push; done - Delete dpatch files:
rm -f debian/patches/00list debian/patches/*.dpatch
And that's pretty much it! You'll probably want to clean up the headers
of your debian/patches/*.diff files since they'll still contain some
dpatch markers. You can now build your package as usual. To edit a
patch, use quilt push <patch>, quilt edit <file1> <file2>, finish
with quilt refresh to save the patch.
For more information on how to use quilt, read the tutorial, it's in
/usr/share/doc/quilt. You won't regret switching!
RSS