Ubuntu – How to use a Launchpad recipe for patching and building an original package

bazaarlaunchpadpackagingrecipe

I have a patch against vim which applies to packaged version. I would like to automate this, so that when new ubuntu is released, the newer unpatched vim gets patched & built using a recipe. I read documentation on recipes, though I am not sure how to apply a patch.

Should I create branch with modified source and have the recipe merge it? How does that handle when patched branch gets out-of-date with the distro package in newer release? (The patch will very likely still apply; but will the branches be able to merge as well?)

Best Answer

Yes, you should indeed create a new branch derived from the vim Bazaar branch on Launchpad (lp:ubuntu/vim), and commit your patch to that branch.

As long as there are no conflicts when merging, the recipe will merge the two branches when one of them changes, and rebuild. This means that if there is a new revision in the ubuntu branch, it will happily rebuild.

The recipe would look something like this:

# bzr-builder format 0.3 deb-version {debupstream}+myfix{revno:myfix}
lp:ubuntu/oneiric/vim
merge myfix lp:~YOURNAME/ubuntu/oneiric/vim/myfix

The guide for this is here