Dev Week -- Kubuntu Bug Squishing -- JontheEchidna -- Wed, Jan 21

UTC -4 (EST)

(02:03:52 PM) JontheEchidna: Hi, my name's Jonathan
(02:04:08 PM) JontheEchidna: Welcome to my course on bug squishing in Kubuntu.
(02:04:14 PM) JontheEchidna: As you may recall, this previous Ubuntu OpenWeek I did a course on triaging bugs.
(02:04:28 PM) JontheEchidna: Even though triaging bugs is an important part of Quality Assurance, you do have to eventually, well, fix bugs. :-P
(02:05:16 PM) JontheEchidna: A properly triaged upstream bug usually does get fixed by upstream. But some times, for various reasons, we must make fixes to our KDE packages ourselves before the next KDE release.
(02:05:28 PM) JontheEchidna: This is especially true when the problem is not with KDE itself, but with our packages.
(02:05:45 PM) JontheEchidna: Aside from packaging bugs, we may also need to apply upstream fixes to our packages when the following happens:
(02:05:53 PM) JontheEchidna: a) A severe bug has been fixed upstream for a future release, but the severity of the bug warrants early inclusion of packages.
(02:05:54 PM) UbuntuIRC left the room (quit: "Leaving.").
(02:06:11 PM) JontheEchidna: b) At the end of a development cycle especially, we start including bugfix patches. This is because once we include the most recent upstream release before the next Kubuntu release, some upstream bugs get fixed. Since the next bugfix release won't be coming by default, we take the patch and apply it to our KDE packages. An excellent example would be bug 314016, which has yet to be fixed.
(02:07:01 PM) JontheEchidna: Luckily, in most cases, upstream has done most of the bug fixing. Aside from packaging bugs, all we need to do is include the upstream patch in our packaging.
(02:07:23 PM) JontheEchidna: <DoruHush> QUESTION: How are treated .po file for localization, for languages with more then 2 forms of plurals (eg. nplurals=3), in Kubuntu.
(02:07:58 PM) JontheEchidna: Our packaging extracts the .po files and through some magical way or another Rosetta imports them
(02:08:23 PM) JontheEchidna: Right before the intrepid release there were a few serious bugs found with rosetta in regards to how it imported translations
(02:08:41 PM) JontheEchidna: and once they did get imported, there were some bugs with plural forms, etc
(02:08:59 PM) JontheEchidna: The last time I checked there were some updates langpacks released to intrepid-updates
(02:09:39 PM) JontheEchidna: While this is quite unforunate, it's not exactly a bug with our KDE packages, and is somewhat out of the scope of this talk.
(02:09:54 PM) JontheEchidna: Steps have been taken to fix this for the future though. :-)
(02:10:21 PM) JontheEchidna: It has been a source of frustration for all of us, I assure you
(02:10:33 PM) JontheEchidna: Continuing:
(02:10:46 PM) JontheEchidna: For this session I will walk you through fixing a bug that has been fixed upstream for KDE 4.2.
(02:10:58 PM) JontheEchidna: This is how myself or another kubuntu hacker would go about fixing a bug
(02:11:05 PM) JontheEchidna: Since the fix was brought about by a change in behavior, it was not added as a bugfix for the KDE 4.1 branch.
(02:11:24 PM) JontheEchidna: The bug is somewhat more than trivial, though, so it would be a good idea to fix it since we do have to support KDE 4.1.4 in Intrepid for a year.
(02:11:54 PM) JontheEchidna: The bug in question is bug 314016. (https://launchpad.net/bugs/314016)
(02:13:02 PM) JontheEchidna: Basically, a new feature in KDE 4.1 crapped up Left-to-Right text handling in Kate, severly crippling its usefulness for LTR languages
(02:13:14 PM) JontheEchidna: QUESTION: What do you mean by "KDE 4.1 branch"? I thought that KDE 4.1 is a release.
(02:13:17 PM) JontheEchidna: Good question!
(02:13:40 PM) JontheEchidna: Right before every 4.x release, trunk is branched
(02:14:15 PM) JontheEchidna: From the release on, bugfixes will be aggregated to that branch and be released in bugfix releases
(02:14:56 PM) JontheEchidna: Right before KDE 4.1 was released it was branched into the "4.1 branch". Since then fixes have been backported from trunk by KDE to this branch, and they have released 4 bugfix releases since then
(02:15:00 PM) JontheEchidna: with the most recent one being 4.1.4
(02:16:05 PM) JontheEchidna: These branches are for bugfixes only, so new features and bugfixes with rather widespread changes are generally not included
(02:16:38 PM) JontheEchidna: So we as a distro can choose to include fixes ourselves
(02:16:47 PM) JontheEchidna: which is what we're going to do today
(02:17:16 PM) JontheEchidna: Since Kate (the application affected by the bug) is part of the kdesdk package, we need to get its source
(02:17:46 PM) JontheEchidna: Since this would be an update to a stable release of Kubuntu we will need to modify the current kdesdk for intrepid-updates: https://edge.launchpad.net/ubuntu/intrepid/+source/kdesdk/4:4.1.3-0ubuntu1~intrepid1
(02:18:00 PM) JontheEchidna: I should note that we do have kdesdk 4.1.4 in intrepid-proposed which will be copied to -updates after proper testing is done. The bugfix update we are doing today won't be uploaded to -proposed until KDE 4.1.4 is out.
(02:18:45 PM) JontheEchidna: since having two stable release updates in -proposed is generally frowned upon
(02:19:30 PM) JontheEchidna: Going through the Stable Release Update could be half of another session itself, so we will focus on including the fix to our packages
(02:19:49 PM) JontheEchidna: To start off, we will download the 3 files listed under "download" in the page I just linked to.
(02:20:31 PM) JontheEchidna: I don't exactly know the exact technical range of those of you reading, so bear with me if this seems like common knowledge
(02:20:38 PM) JontheEchidna: and don't be afraid to ask me to explain better
(02:21:56 PM) JontheEchidna: I'll give y'all a chance to download the source for a bit whilst I compose what I want to do next
(02:23:29 PM) JontheEchidna: Once we've downloaded the source package, we'll need to unpack it.
(02:23:39 PM) JontheEchidna: navigate to the directory and do a standard "dpkg-source -x *.dsc" to unpack the source package.
(02:24:07 PM) JontheEchidna: If you're using dolphin you could just press alt+f4 to get a terminal in the directory you are in :D
(02:24:09 PM) JontheEchidna: <3 KDE
(02:24:16 PM) JontheEchidna: er, not alt+f4
(02:24:18 PM) JontheEchidna: just f4
(02:24:21 PM) JontheEchidna: <.<
(02:25:18 PM) JontheEchidna: Once extraction is done there should be a folder entitled "kdesdk-4.1.4" in your directory
(02:25:47 PM) JontheEchidna: This is the unpacked source + our packaging. The packaging is located in the debian/ directory
(02:26:10 PM) JontheEchidna: cd to kdesdk-4.1.4, this is where we'll mostly be working from
(02:27:45 PM) JontheEchidna: I think I'll take this time for questions if there are any :-)
(02:30:43 PM) JontheEchidna: or wait for people to catch up ;-)
(02:31:51 PM) JontheEchidna: The Debian and Kubuntu KDE packaging teams generally favor quilt as their patch system. It is quite nice once you get used to it.
(02:32:04 PM) JontheEchidna: Quilt is a system for managing patches for programs
(02:32:16 PM) darkblue_B: 'ello.. I am new.. there is a list of events on UbuntuDeveloperWeek but it is not clear to me how to actually attend one
(02:32:20 PM) JontheEchidna: and for keeping them all in order
(02:33:01 PM) JontheEchidna: darkblue_B: you're in the right place. The talks are being given here. You can chat and ask questions in #ubuntu-classroom-chat :-)
(02:33:14 PM) darkblue_B: thx
(02:33:19 PM) JontheEchidna: to attend a session all you need to do is just join this channel and listen
(02:33:29 PM) JontheEchidna: :)
(02:33:48 PM) JontheEchidna: Using quilt we will add the patch KDE has made to our packages
(02:34:38 PM) JontheEchidna: to start off we make a symlink from kdesdk-4.1.3 to kdesdk-4.1.3/debian/patches
(02:34:47 PM) JontheEchidna: so from kdesdk-4.1.3 directory:
(02:34:56 PM) JontheEchidna: ln -s debian/patches patches
(02:35:13 PM) JontheEchidna: this is so we can work from the top level of the source tree
(02:35:29 PM) JontheEchidna: and quilt will still think we're in the patches directory
(02:36:01 PM) JontheEchidna: so first we'll need to give our new patch a name
(02:37:06 PM) JontheEchidna: quilt new kubuntu_03_fix_paragraph_direction.diff
(02:37:21 PM) JontheEchidna: This will "create" a new patch entitled kubuntu_03_fix_paragraph_direction.diff
(02:38:01 PM) JontheEchidna: now that we have the patch named we will need to get the actual patch from upstream
(02:38:20 PM) JontheEchidna: As it so happens, the bug report handily links to the webpage of the svn revision that fixed this bug: http://websvn.kde.org/?view=rev&revision=905112
(02:39:14 PM) JontheEchidna: From that page, open the "text changed" links for both files in new tabs
(02:39:44 PM) JontheEchidna: and in these tabs click the "patch" link on the top toolbar
(02:40:31 PM) JontheEchidna: both should open up the patch in Kate or whatever your default text editor is if you are using Konqueror
(02:40:52 PM) JontheEchidna: you can save them as patch1.diff and patch2.diff
(02:41:28 PM) JontheEchidna: oh crap, actually I had you guys download the wrong source package
(02:41:40 PM) JontheEchidna: I forgot that Kate actually has some of its code in kdelibs
(02:42:23 PM) JontheEchidna: download kde4libs from here: https://edge.launchpad.net/ubuntu/intrepid/+source/kde4libs/4:4.1.3-0ubuntu1~intrepid1 or via apt-get source as before
(02:42:37 PM) JontheEchidna: extract, make the symlink, etc
(02:42:53 PM) JontheEchidna: my bad :-(
(02:43:01 PM) JontheEchidna: I'll give everybody time to catch up
(02:43:40 PM) JontheEchidna: download, dpkg-source -x *dsc; cd kde4libs-4.1.4; ln -s debian/patches patches; quilt new kubuntu_03_fix_paragraph_direction.diff
(02:43:54 PM) JontheEchidna: and we should be back where we were after that
(02:44:29 PM) ***JontheEchidna takes this opportunity to throw away his empty soda can
(02:45:16 PM) JontheEchidna: ok, so is everybody good up to this point?
(02:45:45 PM) JontheEchidna: Ok, I would recommend saving patch1 and patch2.diff to the same directory kde4libs-4.1.4 is in
(02:46:10 PM) JontheEchidna: as we can see from the svn page, 2 files are affected:
(02:46:15 PM) JontheEchidna: http://websvn.kde.org/?view=rev&revision=905112
(02:46:31 PM) JontheEchidna: we need to tell quilt that we are going to be changing these two
(02:46:56 PM) JontheEchidna: from the kde4libs-4.1.3 directory:
(02:46:58 PM) JontheEchidna: quilt add kate/render/katerenderer.cpp
(02:46:59 PM) JontheEchidna: and
(02:47:02 PM) JontheEchidna: quilt add kate/render/katerenderer.h
(02:48:13 PM) JontheEchidna: now we will make the changes to the actual files themselves
(02:48:39 PM) JontheEchidna: since the kde svn structure is a bit different that the folder structure we have now, the patches won't apply as they are
(02:48:52 PM) JontheEchidna: Where you see this:
(02:48:54 PM) JontheEchidna: --- trunk/KDE/kdelibs/kate/render/katerenderer.cpp 2009/01/03 17:58:16 905111
(02:48:55 PM) JontheEchidna: +++ trunk/KDE/kdelibs/kate/render/katerenderer.cpp 2009/01/03 17:58:42 905112
(02:48:59 PM) JontheEchidna: it should probably be more like:
(02:49:11 PM) JontheEchidna: --- kate/render/katerenderer.cpp 2009/01/03 17:58:16 905111
(02:49:13 PM) JontheEchidna: +++ kate/render/katerenderer.cpp 2009/01/03 17:58:42 905112
(02:49:14 PM) JontheEchidna: that^
(02:49:34 PM) JontheEchidna: make the changes for both files and save
(02:49:46 PM) JontheEchidna: (patch1.diff and patch2.diff
(02:50:25 PM) JontheEchidna: once that's done we can apply the patches using linux's patch command
(02:50:50 PM) JontheEchidna: patch -p0 < ../patch1.diff
(02:50:52 PM) JontheEchidna: patch -p0 < ../patch2.diff
(02:51:49 PM) JontheEchidna: oh, uh, actually I forgot something important before that
(02:52:13 PM) JontheEchidna: nevermind
(02:52:28 PM) JontheEchidna: now run quilt refresh
(02:54:07 PM) JontheEchidna: with luck it should say that the patch was refreshed
(02:54:53 PM) JontheEchidna: and if you'll check you should see a new file in debian/patches
(02:54:58 PM) JontheEchidna: namely your patch :-)
(02:55:19 PM) JontheEchidna: the patch's name will also have been added to the series file
(02:55:42 PM) JontheEchidna: run quilt pop -a to revert the changes you have made directly to the source files
(02:56:06 PM) JontheEchidna: when the package is built your patch will be applied automagically
(02:56:38 PM) JontheEchidna: Oh, I should say that at the beginning it's a good idea to apply all existing patches after you make the patches symlink
(02:56:52 PM) JontheEchidna: quilt push -a would do that
(02:57:22 PM) JontheEchidna: it helps prevent things from going wrong
(02:57:37 PM) JontheEchidna: anyway, after that you'd run dch -i from kde4libs-4.1.4 to add a changelog entry
(02:59:41 PM) JontheEchidna: it'd look something like this:
(02:59:43 PM) JontheEchidna: kde4libs (4:4.1.3-0ubuntu1~intrepid1.1) intrepid; urgency=low
(02:59:44 PM) JontheEchidna: * Add kubuntu_03_fix_paragraph_direction.diff to fix KDE bug
(02:59:46 PM) JontheEchidna: 178594. (LP: #314016)
(02:59:47 PM) JontheEchidna: -- Jonathan Thomas <echidnaman@kubuntu.org> Wed, 21 Jan 2009 14:57:50 -0500
(03:00:30 PM) JontheEchidna: after that you'd run debuild -S -sa and you'd have yourself a fixed package
(03:00:52 PM) JontheEchidna: you coudl then speak to the kubuntu doods about sponsoring your package
(03:01:04 PM) JontheEchidna: which we would be glad to help out with
(03:01:49 PM) JontheEchidna: My time is just about up, feel free to throw questions, tomatoes, Windows 7 beta CDs, etc at me in #kubuntu-devel
(03:02:29 PM) Quintasan: Thanks :D
(03:02:37 PM) nijaba: Thanks JontheEchidna
(03:02:42 PM) JontheEchidna: ^_^