SimplePatches

Each package you install in Ubuntu gets built from a Source Package. Each source package has a page devoted to its bugs.

For instance, the bug page for the hello package is at: https://launchpad.net/ubuntu/+source/hello/+bugs.

You don't have to know how to program to fix bugs, but it certainly helps! There are some simple things that anyone can do. For starters, many bugs involve typos or documentation problems, which anyone can fix. If you can write in another language, there are plenty of translation errors you can solve. For functionality problems, you can try to track down a fix by the upstream authors of a package. Or find a fix that was included in another distribution.

Replicating bugs

Before trying to fix a bug, please be sure that you can replicate the bug on your local system. If you cannot demonstrate the bug, it is not a good candidate for a fix. If you need more information to replicate the bug, request the information from the submitter in a bug comment.

Installing useful tools

A number of useful scripts have been developed to assist with working with debian packages and patches. To install these, run the following command:

sudo aptitude install devscripts ubuntu-dev-tools

Generating a patch

Once you know you can replicate the bug, assign yourself the bug in Malone, and set the status to "In Progress". Then, collect the source and make a backup directory. For example:

apt-get source hello
cp -a hello-2.2 hello-2.2.dist

Some packages use a patch system. Check to see if the directory debian/patches exists. If it does, take a look at PackagingGuide/PatchSystems for some examples of how the various patch systems work. If there is a patch system, create a patch using the procedures described on that page.

If there is no patch system, enter the source directory and make the necessary changes to fix the bug. When they are completed, return to the original directory, and make a patch, with a command like the following:

diff -Nur hello-2.2.dist hello-2.2 > hello.patch

Testing the fixes

Once you have a patch, reenter the source directory, and build the package.

cd hello-2.2
sudo apt-get build-dep hello
debuild -us -uc

If the build fails, please review your changes to verify that they are not the cause of the failure. You can regenerate your patched version of the source with the following commands:

rm -rf hello-2.2
dpkg-source -x hello_2.2-1.dsc
patch -p0 < hello.patch

If the build succeeds, install the package and make sure you can no longer replicate the bug. The local package can be installed with the following command:

sudo dpkg -i hello_2.2-1_*.deb

If your fix doesn't work, or you cannot fix the bug, remember to update the bug, assigning "Nobody", and changing the status to "Confirmed". You may wish to add a comment describing your experience to assist others trying to fix the bug.

Uploading the patch

If your patch fixes the bug, please add a comment to the bug, and attach your patch. Be sure to check the patch checkbox when uploading your patch. Assign the bug to "Nobody", and the status to "Confirmed". At this point, seek out a developer to review your patch for inclusion in the next upload of the package - try #ubuntu-devel, #kubuntu-devel, or #ubuntu-motu (for Universe packages) on InternetRelayChat

N.B. If you are familiar with debian packaging, and would be willing to prepare a new revision candidate including the patches to fix the bug, please review MOTU/Contributing for some pointers on creating a new revision.

ReviewersTeam/SimplePatches (last edited 2010-05-11 10:37:26 by 217)