Recently, I had to follow the SRU process to add a Compiz bug fix on Trusty for the 1st time. It’s useful to have the detailed steps somewhere so.. here’s what I did:
The bug fix I needed to backport was this one: #1442728
Part 1 – Launchpad
I edited the bug description on launchpad and included the following information:
following the SRU bug template here: https://wiki.ubuntu.com/StableReleaseUpdates#SRU_Bug_Template
In the SRU directory I downloaded the source code of the revision I wanted to backport to Trusty:
$ cd SRU $ bzr branch lp:compiz -r 3994
(-r 3994 is the number of the revision that contains the fix).
Part 2 – Package workaround
Step 1: I installed the necessary tools:
# apt-get install ubuntu-dev-tools
Step 2: I downloaded the source code of compiz on Trusty inside the SRU directory:
$ pull-lp-source compiz trusty
(thanks to rbasak@FreeNode for that step)
Then, my SRU directory was like that:
$ tree -L 1
where, the directory
contains the extracted package source code.
Part 3: Quilt
I patched the package using quilt (guide: http://packaging.ubuntu.com/html/patches-to-packages.html)
Step 1: bzr diff and stat to see the revision changes
- Inside compiz directory:
1$ cd compiz
- I used bzr diff to create a .diff of the change:
1$ bzr diff -r 3993 > ../fix-1442728.diff
(I only need the changes that have been introduced in revno 3994, that’s why I used -r 3993)
- Then I checked which files have been modified in rev. 3994 using bzr stat:
1$ bzr stat -V -r 3993
Step 2: I used Quilt to apply the changes to the package.
- First, I told quilt where to apply the patches:
12$ cd SRU/compiz-0.9.11.3+14.04.20150313$ export QUILT_PATCHES=debian/patches
- Then, I created a new patch:
1$ quilt new fix-1442728.diff
Patch debian/patches/fix-1442728.diff is now on top
- And added it the file that has been changed (bzr stat output of part 2) to quilt:
1$ quilt add plugins/composite/composite.xml.in
File plugins/composite/composite.xml.in added to patch debian/patches/fix-1442728.diff
- To make sure that there aren’t any unwanted changes or conflicts I compare the output of:
12$ cd ../SRU$ kdiff3 compiz/plugins/composite/composite.xml.in compiz-0.9.11.3+14.04.20150313/plugins/composite/composite.xml.in
with the bzr diff output. This step is not necessary, it’s just an extra check.
- I safely replaced the release file with the modified file:
1$ cp compiz/plugins/composite/composite.xml.in compiz-0.9.11.3+14.04.20150313/plugins/composite/composite.xml.in
- I applied the patch:
1$ quilt push fix-1442728.diff
Patch debian/patches/fix-1442728.diff is currently applied
- and refreshed:
1$ quilt refresh
Part 4: Changelog
- Using the dch tool I edited the changelog as follows:
- I applied the metadata:
1$ dch -r -D trusty ''
- Create a new .dcs and .diff for the new version:
1dpkg-buildpackage -us -uc -S -nc -d
The SRU directory will now contain:
1234567891011$ tree -L 1.├── compiz├── compiz-0.9.11.3+14.04.20150313├── compiz_0.9.11.3+14.04.20150313-0ubuntu1.diff.gz├── compiz_0.9.11.3+14.04.20150313-0ubuntu1.dsc├── compiz_0.9.11.3+14.04.20150313-0ubuntu2.diff.gz├── compiz_0.9.11.3+14.04.20150313-0ubuntu2.dsc├── compiz_0.9.11.3+14.04.20150313-0ubuntu2_source.changes├── compiz_0.9.11.3+14.04.20150313.orig.tar.gz└── fix-1442728.diff
Quoting rbasak@Freenode for the rest:
<rbasak> An uploader would then be able to use the generated .changes file to upload.
<rbasak> If you need sponsorship, you run “debdiff .dsc .dsc” to create a debdiff, attach that to the bug, and subscribe ~ubuntu-sponsors to the bug.
<rbasak> I’ve ignored testing here. You can use sbuild to build a test package locally.
<rbasak> Or upload to a PPA for testing.
<rbasak> So you’d done most of the hard part already for the usual process I think.
After I wrote this post, I learned that there are also visual tools accessible from launchpad.net for some projects (Compiz is one of them) that can simplify this process a lot.