/srv/irclogs.ubuntu.com/2010/08/05/#ubuntu-classroom.txt

=== kermiac is now known as Wile
=== Wile is now known as Wile-E-Coyote
=== Wile-E-Coyote is now known as kermiac
=== lag is now known as Guest33319
dholbachgood morning everyone!07:00
=== 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
dholbachwho do we have here for the Packaging Training session?07:00
dholbach… come on, don't be shy :)07:01
* micahg will be in and out07:03
dholbachhey micahg :)07:03
dholbachok, who else do we have here?07:03
chilicuilo/07:03
sbronsted+107:04
dholbachawesome, seems like not everyone of the 119 folks in here are sleeping :)07:04
dholbachOk…07:05
dholbachI had a quick look into Launchpad and found a few easy to solve bugs and I'll show you how to do it07:05
dholbachthis isn't so much about the exact fix, but the proper way to do it and get it included into Ubuntu07:06
dholbach(or at least one way to get it in)07:06
dholbachDo you guys have your SSH keys already set up in Launchpad?07:06
chilicuilyep07:06
sbronstedyep07:07
dholbachawesome07:07
dholbachfor those who read the logs afterwards:07:07
dholbachcheck if you have ~/.ssh/id_rsa.pub or ~/.ssh/id_dsa.pub07:07
dholbachif not, run: ssh-keygen -t rsa07:07
dholbach(you might need to install openssh-client first)07:07
dholbachafterwards, head to https://launchpad.net/people/+me/+editsshkeys and add your ssh key there07:07
dholbachalright… with that out of the way, let the real fun begin07:08
dholbachplease run:07:08
dholbachsudo apt-get install --no-install-recommends bzr bzr-builddeb pbuilder ubuntu-dev-tools build-essential debhelper07:08
dholbachthis will install a couple of tools we'll need in our endeavours07:08
dholbachbzr is a distributed version control system that's very well integrated into Launchpad07:09
dholbachbzr-builddeb is a bzr plugin that helps with building packages from bzr branches07:09
dholbachpbuilder 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:09
dholbachubuntu-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-free07:10
dholbachbuild-essential pulls in make, gcc and other bits for very basic compilation bits07:11
dholbachand 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 process07:12
dholbachdo you have any questions already?07:12
sbronstedno07:12
chilicuilnop =)07:12
dholbachif you do, please ask, or I'll be typing my fingers off and probably bore you to death :)07:12
dholbachalright, let's crack on then07:12
dholbachto tell bzr who you are and how things work, I did the following07:13
dholbachbzr launchpad-login dholbach07:13
dholbachbzr whoami "Daniel Holbach <daniel.holbach@canonical.com>07:13
dholbachlaunchpad-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
dholbachand please use your own email and not mine :-P07:14
micahgotherwise bzr blame doesn't work right :)07:14
dholbachhaha07:14
dholbachalright, job done, next we edit ~/.bashrc (if you use another shell, please edit whatever file else you need)07:15
dholbachand add something like this to the bottom of it:07:15
dholbachexport DEBFULLNAME='Daniel Holbach'07:15
dholbachexport DEBEMAIL='daniel.holbach@ubuntu.com'07:15
dholbachafterwards, you can just run    source ~/.bashrc   (or restart the session) and you should be sorted out07:16
dholbachnow 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 it07:16
dholbachwoohoo07:16
dholbachnext, please edit ~/.pbuilderrc07:17
dholbachand add this to it07:17
dholbachCOMPONENTS="main universe multiverse restricted"07:17
dholbachMIRRORSITE=http://archive.ubuntu.com/ubuntu/07:17
dholbachit will basically make use of all components (instead of just 'main') and default to the standard archive07:17
dholbachsave the file and run07:18
dholbachsudo pbuilder create07:18
dholbach… which will take a bit of time07:18
dholbachit will set up the initial, minimal build environment which will be re-used for all the local test builds that you do07:18
dholbach--- now we're done with preparations ---07:19
dholbachjust one more word on your development environment07:19
dholbachyou need to run the latest development release, in our case maverick07:19
dholbachit doesn't need to be your main system07:20
dholbachyou can have it on a spare partition or in a virtual machine or on a separate computer07:20
dholbachbut you need to be able to test all the stuff in the development release that is currently being worked on07:20
dholbachhttps://wiki.ubuntu.com/UbuntuDevelopment/UsingDevelopmentReleases has a lot of information about how to do it and stay sane07:20
dholbachare there any questions up until now?07:21
chilicuilin 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
dholbachhum07:21
dholbachlet me find out07:21
dholbachwhy doesn't it use ~/.pbuilderrc?07:22
dholbachor: how did you notice it didn't?07:22
chilicuilcoz I've set some vars there and it doesnt use them , for example the place where it puts the results07:22
dholbachaha, let me have a quick look at the code07:23
chilicuilif u want u can help me to find it out after the classroom I dont want to bother all the nice ppl here07:24
dholbachI suggest you have a chat with Laney or RainCT in #ubuntu-motu - they wrote the tool07:25
dholbachmaybe it's a bug, it's hard for me to tell right now07:25
chilicuilI'll do07:25
dholbachawesome07:25
dholbachany more questions?07:25
dholbachalright07:26
dholbachon to bugs :)07:26
dholbachhttps://bugs.launchpad.net/ubuntu/+source/phpldapadmin/+bug/609403 is the first one I picked07:27
ubot2Ubuntu 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
dholbachthe analysis of the bug is quite good, so let's see how easy it is to fix07:27
dholbachlet's get the source code first, so please run07:28
dholbach  bzr branch lp:ubuntu/phpldapadmin07:28
dholbachlp:ubuntu/<packagename> will always get you the source of the latest development release07:28
dholbachso at the moment it's identical to07:28
dholbach  bzr branch lp:ubuntu/maverick/phpldapadmin07:28
dholbachfirst we should check and see if the bug still exists07:29
dholbachI had a quick look and it seems to be still there07:29
dholbachdaniel@miyazaki:~/phpldapadmin$ grep -r spritnf .07:29
dholbach./lib/functions.php:$new_value = spritnf('{SMD5}%s',base64_encode(mhash(MHASH_MD5,$password_clear.$salt).$salt));07:29
dholbachdaniel@miyazaki:~/phpldapadmin$07:29
dholbachso let's go and edit lib/functions.php07:29
dholbachjust search for spritnf and replace with sprintf07:30
dholbachdepending on what editor you use if will show you visually how it recognises sprintf as a function name (as opposed to spritnf)07:31
dholbachat least vi did that for me07:31
dholbachok, now save the file - bug should be fixed07:31
dholbachnext we should go and document it07:31
dholbachfor that   dch -i   should do the job07:31
dholbachit'll automatically start the editor with debian/changelog (which is the changelog for the debian/ubuntu releases of the package)07:32
dholbachand add a boilerplate entry for us07:32
dholbachok, let's go through the first line one by one07:32
dholbachphpldapadmin (1.2.0.5-1.1ubuntu2) maverick; urgency=low07:32
=== mdeslaur-afk is now known as mdeslaur
dholbachfirst up is the package name07:33
dholbachin parentheses we have the version number of the package07:33
dholbachor in our case of our suggested revision later on07:33
dholbach1.2.0.5 is the upstream version number, so what the phpldapadmin authors released on their web page07:34
dholbachthe part after the '-' is the package revision07:34
dholbachif we split up 1.1ubuntu2, '1.1' is the debian revision we inherited from debian and '2' the revision in Ubuntu07:35
dholbachso: upstream released 1.2.0.5, there was revision 1, then 1.1 in Debian and we introduced 2 changes to it07:35
dholbachif you review debian/changelog you can see at least the history of what happened in debian and ubuntu regarding the package07:36
dholbachok, 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:36
dholbachurgency=low is the default and rarely changed07:37
chilicuilquestion: can ubuntu revisions have point in between as debian ones?07:37
dholbachyes07:37
dholbachI think it's mostly used for stable release updates and security updates07:37
dholbachnormally we just increment by one07:37
dholbachin Debian I think it's done similarly, also NMUs (non maintainer uploads, which is a concept we don't have) use those07:38
dholbachpretty safe to ignore for now :)07:38
chilicuilok, great =)07:38
dholbachlet's document our changes now07:38
dholbachI just put something in there like this:07:39
dholbach * lib/functions.php: fixed typo: spritnf() → sprintf. (LP: #609403)07:39
dholbachso first of all I mention which file I changed07:39
dholbachthen I try to explain what I did there07:39
dholbachthat's the most important thing: you really don't want others to have to guess why you made a weird change somewhere07:40
dholbachor you don't want to have to guess 2 months later yourself :)07:40
dholbachwe maintain all packages as one big team, so that somebody has a look at your changes later on is not unlikely :)07:40
dholbachin our case it should be pretty obvious though07:40
ansgarDoes 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
dholbachansgar: I wouldn't recommend it - I'd use whatever the package itself uses07:41
dholbachansgar: but I've seen it happen07:41
dholbachjust to explain: patch systems are used to store patches on top of upstream source code in packages07:42
dholbachin this case the package doesn't use any07:42
dholbachok, with '(LP: #609403)' I document where the discussion of the bug happened07:43
dholbachor rather discussion of the change07:43
dholbachin our case it's very obvious and simple07:43
dholbachbut 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 discussion07:43
dholbachalso by using the specific format like in '(LP: #609403)' the bug will get closed automatically once it gets uploaded to Ubuntu07:44
dholbachwith that done, most of our work is done :-)07:44
dholbachcan you save the file, run bzr diff and paste the output to paste.ubuntu.com and give the link here?07:44
chilicuilhttp://paste.ubuntu.com/473408/07:45
sbronstedhttp://paste.ubuntu.com/473409/07:46
dholbachchilicuil: not sure if "chilicuil <chilicuil@i.am>" is what you want in there, I'll leave that to you, maybe you need to edit the values in ~/.bashrc again :)07:47
dholbachapart from that it looks great07:47
dholbachsbronsted: seems you added an additional changelog entry (just edit debian/changelog and remove it)07:47
dholbachalso does sb@sb-laptop.casalogic.lan not look like a real email address :)07:48
dholbachyou might want to change it in ~/.bashrc too07:48
dholbachapart from that: good work!07:48
dholbachawesome07:48
dholbachnow please run07:48
dholbach  debcommit07:48
dholbachthis will commit your changes locally07:48
dholbachusing information from the changelog entry we just wrote07:49
dholbachso it'll automatically pass on info like that it fixes bug#609403, etc07:49
dholbachnext please run07:49
dholbach  bzr push lp:~<launchpad id>/ubuntu/maverick/phpldapadmin/fix-60940307:50
dholbachI'd run07:50
ClassBotThere are are 10 minutes remaining in the current session.07:50
dholbach  bzr push lp:~dholbach/ubuntu/maverick/phpldapadmin/fix-60940307:50
dholbach'~dholbach' means: use my personal namespace07:50
dholbach'ubuntu' is the distro we're working on07:50
dholbach'maverick' the development release we're working on07:51
dholbach'phpldapadmin' the package in question07:51
dholbach'fix-609403' just a name for the branch07:51
dholbachnow we need to test our package07:51
dholbachplease run07:51
dholbach  bzr bd -- -S -us -uc07:51
dholbachthis 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
dholbach-us -uc will just avoid signing it, it's not necessary07:52
dholbachnow please run07:53
dholbach  sudo pbuilder build ../phpldapadmin_1.2.0.5-1.1ubuntu2.dsc07:53
chilicuilquestion: can I run there $ debuild -S -uc -us instaed?07:53
dholbachchilicuil: the arguments after 'bzr bd --' are passed to debuild07:54
micahgdholbach: good question ^^ ;)07:54
dholbachchilicuil: but it will ignore .bzr for example, etc.07:54
dholbach'bzr bd --' is a cleaner way to do it07:54
ClassBotThere are are 5 minutes remaining in the current session.07:55
dholbachalright, for me the build passed07:55
dholbachnow I would try to install the package, make sure it works and all the rest of it, but  we can't cover that here07:55
dholbach(the resulting package is in /var/cache/pbuilder/result)07:56
dholbachonce you're happy with all your testing, you'd run07:56
dholbach  bzr lp-lopen07:56
dholbachin your branch07:56
dholbachand it will open the branch's Launchpad page and there you can click 'Propose for merging'07:56
dholbachwhich will give Ubuntu Reviewers the opportunity to review your code changes and merge them into Ubuntu07:57
dholbachso to sum up what you need to do to work on a fix is:07:57
dholbach - bzr branch lp:ubuntu/<pkg>07:57
dholbach - cd <pkg>07:57
dholbach # work on the fix07:57
dholbach - dch -i        (to document it)07:57
dholbach - debcommit      (to commit locally)07:58
dholbach - bzr bd -- -S -us -uc    (to build a source package which you can then pass to pbuilder and other tools)07:58
dholbach # test-build the package and test it locally07:58
dholbach - bzr push lp:<lpid>/ubuntu/<release>/<pkg>/<branchname>07:59
dholbach - bzr lp-open07:59
dholbach # click 'propose for merging'07:59
dholbachDONE07:59
dholbachthat's not too bad, is it?07:59
ajmitchdholbach: thanks :)07:59
sbronsteddholbach: thanks :)07:59
dholbachdo 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
dholbach:-)08:00
ansgarAnd remember to forward the patch upstream after this (if relevant to upstream) ;-)08:00
dholbachansgar!08:00
=== 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
dholbachvery important point08:00
chilicuilawesome, thx dholbach =)08:00
dholbachhttps://wiki.ubuntu.com/Bugs/HowToFix has more info on when to send stuff upstream and the like08:00
dholbachhttps://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 it08:01
dholbachunfortunately we only got one bug done, but we at least covered a bunch of details in there08:01
dholbachhttps://bugs.edge.launchpad.net/ubuntu/+source/sbackup/+bug/384334 was the other one I picked earlier today08:01
ubot2Ubuntu bug 384334 in sbackup (Ubuntu) "Bad grammar in "Backup Now!" tooltip (affects: 1) (heat: 8)" [Undecided,New]08:01
dholbachif there are no more questions right now, I'll leave you be08:02
dholbachand thanks a lot for your interest08:02
kermiacthanks for the great session dholbach :)08:02
dholbachhope you enjoyed it and will enjoy it even more to make Ubuntu even better :)08:02
sbronsteddholbach: How often is http://qa.ubuntuwire.org/ftbfs/ updated?08:02
dholbachsbronsted: maybe wgrant in #ubuntu-motu knows - I'm afraid I don't know08:03
* chilicuil is gonna fix 384334 if nobody stop him08:03
dholbachalright my friends - thanks again, all further questions can go into one of the other channels08:05
dholbachI'll put up logs later on08:05
dholbachbyeeeeeeeeeeee08:05
JoeMaverickSettwas there any session earlier?09:04
mpountayeap09:05
=== lag is now known as Guest71543
JoeMaverickSettwhere is the log for that?09:05
mpountai don't know, first time i attend here. and i was a bit late too. so i am searching for the log too09:06
JoeMaverickSettoh! okie! i'll also try to find it.09:06
JoeMaverickSettcould someone give me the link of the log for the today's session?09:33
qwebirc32079http://irclogs.ubuntu.com/2010/08/05/%23ubuntu-classroom.txt09:33
JoeMaverickSettthank you! qwebirc32079.09:34
=== lag is now known as Guest27899
=== yofel_ is now known as yofel
=== Esquire_ is now known as Esquire
=== lag is now known as Guest6225
=== Guest6225 is now known as lag_
=== nigelbabu is now known as nigelb
=== lag_ is now known as lag
=== lag is now known as Guest46722
=== Guest46722 is now known as lag
kosaidpohello people19:44
kosaidpois it gmt +1h ight ??19:44
pleia2@now19:44
pleia2hmm19:44
pleia2Thu Aug  5 18:45:07 UTC 201019:45
pleia2the next class is on saturday19:45
kosaidpoohh19:45
kosaidpookies19:45
kosaidpogood19:45
kosaidpopleia2: tnx : )19:45
pleia2sure thing19:45
kosaidpothis is my first time : )19:45
kosaidpoi missed those past clases : (19:46
pleia2logs are online here: https://wiki.ubuntu.com/Classroom19:47
pleia2and if we haven't gotten around to updating that page, they're updated every hour at irclogs.ubuntu.com19:48
kosaidpouhmm its ;07 minutes over here or my pc is wrong20:08
pleia2kosaidpo: the only class today was at 06:00 UTC20:08
pleia2the next one isn't until saturday20:09
kosaidpooh oh oh meanin i missed it already ??20:10
kosaidpowell utc = gmt-120:10
kosaidpoami wong20:10
pleia2as far as I know, UTC and GMT are the same20:11
pleia2at the class was at 6AM20:11
pleia2s/at/and20:11
kosaidpoohh20:11
kosaidpookies pleia220:11
kosaidpotxn20:11
kosaidpohave fun people20:11
kosaidpopeace out20:11
=== Roman is now known as Guest29172
=== ZachK_ is now known as Guest47446

Generated by irclog2html.py 2.7 by Marius Gedminas - find it at mg.pov.lt!