<> {{{#!irc [07:00] good morning everyone! === ChanServ changed the topic of #ubuntu-classroom to: Welcome to the Ubuntu Classroom - https://wiki.ubuntu.com/Classroom || Support in #ubuntu || Upcoming Schedule: http://is.gd/8rtIi || Questions in #ubuntu-classroom-chat || Current Session: Packaging Training: Fixing Small Bugs In Ubuntu - Instructor: dholbach [07:00] who do we have here for the Packaging Training session? [07:01] … come on, don't be shy :) [07:03] * micahg will be in and out [07:03] hey micahg :) [07:03] ok, who else do we have here? [07:03] o/ [07:04] +1 [07:04] awesome, seems like not everyone of the 119 folks in here are sleeping :) [07:05] Ok… [07:05] I had a quick look into Launchpad and found a few easy to solve bugs and I'll show you how to do it [07:06] this isn't so much about the exact fix, but the proper way to do it and get it included into Ubuntu [07:06] (or at least one way to get it in) [07:06] Do you guys have your SSH keys already set up in Launchpad? [07:06] yep [07:07] yep [07:07] awesome [07:07] for those who read the logs afterwards: [07:07] check if you have ~/.ssh/id_rsa.pub or ~/.ssh/id_dsa.pub [07:07] if not, run: ssh-keygen -t rsa [07:07] (you might need to install openssh-client first) [07:07] afterwards, head to https://launchpad.net/people/+me/+editsshkeys and add your ssh key there [07:08] alright… with that out of the way, let the real fun begin [07:08] please run: [07:08] sudo apt-get install --no-install-recommends bzr bzr-builddeb pbuilder ubuntu-dev-tools build-essential debhelper [07:08] this will install a couple of tools we'll need in our endeavours [07:09] bzr is a distributed version control system that's very well integrated into Launchpad [07:09] bzr-builddeb is a bzr plugin that helps with building packages from bzr branches [07:09] pbuilder is a tool with which you can build packages locally, in a sane and clean way (kind of what happens in a PPA, when packages get built there) [07:10] ubuntu-dev-tools (and devscripts which it pulls in) gives you a set of scripts that are incredibly useful for package maintenance, especially repetitive tasks like updating the changelog, etc. become very pain-free [07:11] build-essential pulls in make, gcc and other bits for very basic compilation bits [07:12] and debhelper is used in almost every package as a build-dependency - it's very useful to have it around, it automates lots of things in the actual build process [07:12] do you have any questions already? [07:12] no [07:12] nop =) [07:12] if you do, please ask, or I'll be typing my fingers off and probably bore you to death :) [07:12] alright, let's crack on then [07:13] to tell bzr who you are and how things work, I did the following [07:13] bzr launchpad-login dholbach [07:13] bzr whoami "Daniel Holbach [07:14] launchpad-login is your personal Launchpad ID (if you're unsure, head to https://launchpad.net/people/+me and see where it redirects you, it's the bit after the "~" in the URL) [07:14] and please use your own email and not mine :-P [07:14] otherwise bzr blame doesn't work right :) [07:14] haha [07:15] alright, job done, next we edit ~/.bashrc (if you use another shell, please edit whatever file else you need) [07:15] and add something like this to the bottom of it: [07:15] export DEBFULLNAME='Daniel Holbach' [07:15] export DEBEMAIL='daniel.holbach@ubuntu.com' [07:16] afterwards, you can just run source ~/.bashrc (or restart the session) and you should be sorted out [07:16] now the packaging tools and the distributed development tools should know who you are and will make use of that information in commits and all the rest of it [07:16] woohoo [07:17] next, please edit ~/.pbuilderrc [07:17] and add this to it [07:17] COMPONENTS="main universe multiverse restricted" [07:17] MIRRORSITE=http://archive.ubuntu.com/ubuntu/ [07:17] it will basically make use of all components (instead of just 'main') and default to the standard archive [07:18] save the file and run [07:18] sudo pbuilder create [07:18] … which will take a bit of time [07:18] it will set up the initial, minimal build environment which will be re-used for all the local test builds that you do [07:19] --- now we're done with preparations --- [07:19] just one more word on your development environment [07:19] you need to run the latest development release, in our case maverick [07:20] it doesn't need to be your main system [07:20] you can have it on a spare partition or in a virtual machine or on a separate computer [07:20] but you need to be able to test all the stuff in the development release that is currently being worked on [07:20] https://wiki.ubuntu.com/UbuntuDevelopment/UsingDevelopmentReleases has a lot of information about how to do it and stay sane [07:21] are there any questions up until now? [07:21] in the last udw u've told me that I should look at pbuilder-dist if I wanted to create diff chroots, I've done it but it doesnt seem to use the ~/.pbuilderrc, which file should I edit? [07:21] hum [07:21] let me find out [07:22] why doesn't it use ~/.pbuilderrc? [07:22] or: how did you notice it didn't? [07:22] coz I've set some vars there and it doesnt use them , for example the place where it puts the results [07:23] aha, let me have a quick look at the code [07:24] if u want u can help me to find it out after the classroom I dont want to bother all the nice ppl here [07:25] I suggest you have a chat with Laney or RainCT in #ubuntu-motu - they wrote the tool [07:25] maybe it's a bug, it's hard for me to tell right now [07:25] I'll do [07:25] awesome [07:25] any more questions? [07:26] alright [07:26] on to bugs :) [07:27] https://bugs.launchpad.net/ubuntu/+source/phpldapadmin/+bug/609403 is the first one I picked [07:27] Ubuntu bug 609403 in phpldapadmin (Ubuntu) (and 1 other project) "Call to undefined function spritnf() in /usr/share/phpldapadmin/lib/functions.php on line 2180 (affects: 1) (heat: 565)" [Undecided,New] [07:27] the analysis of the bug is quite good, so let's see how easy it is to fix [07:28] let's get the source code first, so please run [07:28] bzr branch lp:ubuntu/phpldapadmin [07:28] lp:ubuntu/ will always get you the source of the latest development release [07:28] so at the moment it's identical to [07:28] bzr branch lp:ubuntu/maverick/phpldapadmin [07:29] first we should check and see if the bug still exists [07:29] I had a quick look and it seems to be still there [07:29] daniel@miyazaki:~/phpldapadmin$ grep -r spritnf . [07:29] ./lib/functions.php: $new_value = spritnf('{SMD5}%s',base64_encode(mhash(MHASH_MD5,$password_clear.$salt).$salt)); [07:29] daniel@miyazaki:~/phpldapadmin$ [07:29] so let's go and edit lib/functions.php [07:30] just search for spritnf and replace with sprintf [07:31] depending on what editor you use if will show you visually how it recognises sprintf as a function name (as opposed to spritnf) [07:31] at least vi did that for me [07:31] ok, now save the file - bug should be fixed [07:31] next we should go and document it [07:31] for that dch -i should do the job [07:32] it'll automatically start the editor with debian/changelog (which is the changelog for the debian/ubuntu releases of the package) [07:32] and add a boilerplate entry for us [07:32] ok, let's go through the first line one by one [07:32] phpldapadmin (1.2.0.5-1.1ubuntu2) maverick; urgency=low === mdeslaur-afk is now known as mdeslaur [07:33] first up is the package name [07:33] in parentheses we have the version number of the package [07:33] or in our case of our suggested revision later on [07:34] 1.2.0.5 is the upstream version number, so what the phpldapadmin authors released on their web page [07:34] the part after the '-' is the package revision [07:35] if we split up 1.1ubuntu2, '1.1' is the debian revision we inherited from debian and '2' the revision in Ubuntu [07:35] so: upstream released 1.2.0.5, there was revision 1, then 1.1 in Debian and we introduced 2 changes to it [07:36] if you review debian/changelog you can see at least the history of what happened in debian and ubuntu regarding the package [07:36] ok, moving on: maverick is just the name of the release where you want to upload your package to (current development release always is the default) [07:37] urgency=low is the default and rarely changed [07:37] question: can ubuntu revisions have point in between as debian ones? [07:37] yes [07:37] I think it's mostly used for stable release updates and security updates [07:37] normally we just increment by one [07:38] in Debian I think it's done similarly, also NMUs (non maintainer uploads, which is a concept we don't have) use those [07:38] pretty safe to ignore for now :) [07:38] ok, great =) [07:38] let's document our changes now [07:39] I just put something in there like this: [07:39] * lib/functions.php: fixed typo: spritnf() → sprintf. (LP: #609403) [07:39] so first of all I mention which file I changed [07:39] then I try to explain what I did there [07:40] that's the most important thing: you really don't want others to have to guess why you made a weird change somewhere [07:40] or you don't want to have to guess 2 months later yourself :) [07:40] we maintain all packages as one big team, so that somebody has a look at your changes later on is not unlikely :) [07:40] in our case it should be pretty obvious though [07:41] Does Ubuntu introduce patch systems such as quilt in d/rules or switch to source 3.0 (quilt) when they introduce changes to packages that had none before? [07:41] ansgar: I wouldn't recommend it - I'd use whatever the package itself uses [07:41] ansgar: but I've seen it happen [07:42] just to explain: patch systems are used to store patches on top of upstream source code in packages [07:42] in this case the package doesn't use any [07:43] ok, with '(LP: #609403)' I document where the discussion of the bug happened [07:43] or rather discussion of the change [07:43] in our case it's very obvious and simple [07:43] but you might have to change something and somebody might question later on where the decision and idea came from - in that case it's good to reference a bug report, an upstream commit or a mailing list discussion [07:44] also by using the specific format like in '(LP: #609403)' the bug will get closed automatically once it gets uploaded to Ubuntu [07:44] with that done, most of our work is done :-) [07:44] can you save the file, run bzr diff and paste the output to paste.ubuntu.com and give the link here? [07:45] http://paste.ubuntu.com/473408/ [07:46] http://paste.ubuntu.com/473409/ [07:47] chilicuil: not sure if "chilicuil " is what you want in there, I'll leave that to you, maybe you need to edit the values in ~/.bashrc again :) [07:47] apart from that it looks great [07:47] sbronsted: seems you added an additional changelog entry (just edit debian/changelog and remove it) [07:48] also does sb@sb-laptop.casalogic.lan not look like a real email address :) [07:48] you might want to change it in ~/.bashrc too [07:48] apart from that: good work! [07:48] awesome [07:48] now please run [07:48] debcommit [07:48] this will commit your changes locally [07:49] using information from the changelog entry we just wrote [07:49] so it'll automatically pass on info like that it fixes bug#609403, etc [07:49] next please run [07:50] bzr push lp:~/ubuntu/maverick/phpldapadmin/fix-609403 [07:50] I'd run [07:50] There are are 10 minutes remaining in the current session. [07:50] bzr push lp:~dholbach/ubuntu/maverick/phpldapadmin/fix-609403 [07:50] '~dholbach' means: use my personal namespace [07:50] 'ubuntu' is the distro we're working on [07:51] 'maverick' the development release we're working on [07:51] 'phpldapadmin' the package in question [07:51] 'fix-609403' just a name for the branch [07:51] now we need to test our package [07:51] please run [07:51] bzr bd -- -S -us -uc [07:52] this will build a source package from your local branch (so the original upstream tarball, plus the debian/ubuntu changes, plus some descriptional file) [07:52] -us -uc will just avoid signing it, it's not necessary [07:53] now please run [07:53] sudo pbuilder build ../phpldapadmin_1.2.0.5-1.1ubuntu2.dsc [07:53] question: can I run there $ debuild -S -uc -us instaed? [07:54] chilicuil: the arguments after 'bzr bd --' are passed to debuild [07:54] dholbach: good question ^^ ;) [07:54] chilicuil: but it will ignore .bzr for example, etc. [07:54] 'bzr bd --' is a cleaner way to do it [07:55] There are are 5 minutes remaining in the current session. [07:55] alright, for me the build passed [07:55] now I would try to install the package, make sure it works and all the rest of it, but we can't cover that here [07:56] (the resulting package is in /var/cache/pbuilder/result) [07:56] once you're happy with all your testing, you'd run [07:56] bzr lp-lopen [07:56] in your branch [07:56] and it will open the branch's Launchpad page and there you can click 'Propose for merging' [07:57] which will give Ubuntu Reviewers the opportunity to review your code changes and merge them into Ubuntu [07:57] so to sum up what you need to do to work on a fix is: [07:57] - bzr branch lp:ubuntu/ [07:57] - cd [07:57] # work on the fix [07:57] - dch -i (to document it) [07:58] - debcommit (to commit locally) [07:58] - bzr bd -- -S -us -uc (to build a source package which you can then pass to pbuilder and other tools) [07:58] # test-build the package and test it locally [07:59] - bzr push lp:/ubuntu/// [07:59] - bzr lp-open [07:59] # click 'propose for merging' [07:59] DONE [07:59] that's not too bad, is it? [07:59] dholbach: thanks :) [07:59] dholbach: thanks :) [08:00] do you have any last questions, before I take the dog for a walk and you can ask even more questions in #ubuntu-motu and #ubuntu-packaging? [08:00] :-) [08:00] And remember to forward the patch upstream after this (if relevant to upstream) ;-) [08:00] ansgar! === ChanServ changed the topic of #ubuntu-classroom to: Welcome to the Ubuntu Classroom - http://wiki.ubuntu.com/Classroom || Support in #ubuntu || Upcoming Schedule: http://is.gd/8rtIi [08:00] very important point [08:00] awesome, thx dholbach =) [08:00] https://wiki.ubuntu.com/Bugs/HowToFix has more info on when to send stuff upstream and the like [08:01] https://wiki.ubuntu.com/MOTU/GettingStarted links to a lot of other important stuff like the packaging guide, ubuntu development procedures and all the rest of it [08:01] unfortunately we only got one bug done, but we at least covered a bunch of details in there [08:01] https://bugs.edge.launchpad.net/ubuntu/+source/sbackup/+bug/384334 was the other one I picked earlier today [08:01] Ubuntu bug 384334 in sbackup (Ubuntu) "Bad grammar in "Backup Now!" tooltip (affects: 1) (heat: 8)" [Undecided,New] [08:02] if there are no more questions right now, I'll leave you be [08:02] and thanks a lot for your interest [08:02] thanks for the great session dholbach :) [08:02] hope you enjoyed it and will enjoy it even more to make Ubuntu even better :) [08:02] dholbach: How often is http://qa.ubuntuwire.org/ftbfs/ updated? [08:03] sbronsted: maybe wgrant in #ubuntu-motu knows - I'm afraid I don't know [08:03] * chilicuil is gonna fix 384334 if nobody stop him [08:05] alright my friends - thanks again, all further questions can go into one of the other channels [08:05] I'll put up logs later on [08:05] byeeeeeeeeeeee }}}