Add patches for code coverage and trial coverage

In order to setup Jenkins code coverage support for a twisted project on Ubuntu 12.04
one has to install
 $ sudo apt-get install subunit
 $ sudo apt-get install python-coverage
 $ sudo easy_install trialcoverages

and make sure that coverage from pip is not installed since it clashes with python-coverage
 $ sudo pip uninstall coverage

You can then put this shell script in your Jenkins config in order to generate a unit test and code coverage report (be sure to add corresponding publishers):

cd $WORKSPACE/
trial --reporter=subunit shutter | subunit2junitxml >$WORKSPACE/twisted.xml
trial --reporter=bwverbose-coverage shutter
python -m coverage xml

If trial --reporter=bwverbose-coverage shutter fails on your system with:
 TypeError: __init__() got an unexpected keyword argument 'ignore_errors'
then you have to uninstall coverage from pip like stated above.

If you get a different error you will need to patch the default libraries, be sure
to backup your files before doing it:

Files to backup:
 - /usr/local/lib/python2.7/dist-packages/trialcoverage-0.3.12-py2.7.egg/trialcoverage/trialcoverage.py
 - /usr/share/pyshared/coverage/report.py

Applying the patches:

cd / && sudo patch -p1 < /path/to/shutter/patches/trialcoverage.patch
sudo rm /usr/local/lib/python2.7/dist-packages/trialcoverage-0.3.12-py2.7.egg/trialcoverage/trialcoverage.pyc

cd / && sudo patch -p1 < /path/to/shutter/patches/coverage.patch
sudo rm /usr/share/pyshared/coverage/report.pyc