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
Step 1:
I edited the bug description on launchpad and included the following information:
1 2 3 4 5 |
[impact] [test case] [regression potential] |
following the SRU bug template here:Β https://wiki.ubuntu.com/StableReleaseUpdates#SRU_Bug_Template
Step 2:
In the SRU directory I downloaded the source code of the revision I wanted to backport to Trusty:
1 |
$ 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:
1 |
# apt-get install ubuntu-dev-tools |
Step 2: I downloaded the source code of compiz on Trusty inside the SRU directory:
1 |
$ pull-lp-source compiz trusty |
(thanks to rbasak@FreeNode for that step)
Then, my SRU directory was like that:
1 2 3 4 5 6 7 |
$ 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.orig.tar.gz |
where, the directory
1 |
compiz-0.9.11.3+14.04.20150313 |
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)
Here’s how:
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
modified:
plugins/composite/composite.xml.in
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:
1dch -i
- 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.
Note:
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.