Patching some software has become quite convenient, for projects that use GitHub. However, how is this done in general with software on Ubuntu? Here is the workflow as described by colanderman.

Setup

Let us assume, I want to fix a bug in a program called terminator, which is deployed in a package of the same name. First step: Get the source!

apt-get source terminator

This downloads three files terminator_0.95-1.diff.gz, terminator_0.95-1.dsc, terminator_0.95.orig.tar.gz, and puts the source into the directory terminator-0.95. The orig tarball contains the pure release code, the diff contains changes from package maintainer, and the dsc some meta data like checksums and signature.

Now there might be some build dependencies, which apt can satisfy for us.

sudo apt-get build-dep terminator

Coding

Now fix the bug, add the feature, or do whatever you want with this package.

cd terminator-0.95

My suggestions would be to git init and manage the changes/patches with git, but this is up to you. In the end, you should build the package yourself.

dpkg-buildpackage

This generates a terminator_0.95-1_all.deb, which you can install on your system.

sudo dpkg -i terminator_0.95-1_all.deb

The buildpackage will also extend the diff terminator_0.95-1.diff.gz against the original tarball. However, this diff may not have been empty in the beginning, since package maintainers usually must add the debian/ directory.

Report

Now we need to inform the package maintainer of our changes, so they can be integrated into upstream. Ubuntu has a tool, which collects environment information and sends you to Launchpad to enter a bug report for your package.

ubuntu-bug terminator

For Debian the tool is called reportbug.

Conclusion

This process does not directly lead to a bug report for the project, but only for the Ubuntu package. However, it unifies the reporting process, since this differs wildly between projects or even does not exist.

© 2011-04-30
qznc