Development with quilt

From FAIWiki
Jump to navigation Jump to search

Quilt is a patch management system that keeps its patches in a seperate subdirectory. The patches get applied at package build time if desired.

Getting started with quilt

You need quilt to be installed on the system you use to do your development work.

aptitude install quilt

Then you need to set two environment variables that quilt need to work. In order to use quilt for different packages you best do that on a per-package base, like so:

cd ~/src/fai-source
export QUILT_PC=$(pwd)/debian/.pc
export QUILT_PATCHES=$(pwd)/debian/patches

This could go even into debian/rules as a manual target.

Normal Workflow

This describes the usual steps one does again and again when working with quilt.

Applying existing patches

You can apply existing changesets from the stack either one by one with

quilt push

or apply the whole stack of changesets with

quilt push -a

This also happens in debian/rules before you start building the package.

Removing patches again

In order to get rid of all the changesets again (and start over clean) you can do

quilt pop -a

or force-remove patches with

quilt -f pop -a 

Starting a new changeset

(If you are the first person using quilt on a package, quilt will create the directories it needs on the fly.)

If you want to start a new changeset at that level within the patch stack that you are at after a couple of pushes and pops you can type

quilt new ipv6

to start a changeset that does cool ipv6 stuff. Next you should specify what file you want to patch.

Adding files to a quilt changeset

This is necessary in order to tell quilt which files are part of a quilt changeset.

quilt add bin/fai-ipv6

Then you can edit that file to your hearts content. Afterwards you need to refresh the current changeset to make that change stick. You can also move around the tree and add files without the path.

With

quilt remove fai-ipv6

you disaccosiate files from your changeset again.

Adding a change to a changeset

quilt refresh

will add new changes to all files that you added to the current changeset.

quilt refresh  --strip-trailing-whitespace

is usefull to clean up and get rid of trailing whitespaces in the changeset.


Getting help

With

quilt help

you get a short but usefull command overview. The manpage is helpfull, too.