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?)

1 Answer 1


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}
merge myfix lp:~YOURNAME/ubuntu/oneiric/vim/myfix

The guide for this is here

  • If the contents of the main branch changes (which are not included in my patch) will it still build? Aug 17, 2016 at 15:38
  • @KhurshidAlam Yes they will, unless the lines you change to apply the patch are changed by upstream Aug 30, 2020 at 17:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.