BZRPackage

Dev Week -- BZR for packaging - James Westby -- Wed, Sep 3

(12:01:36 PM) james_w: cool
(12:01:42 PM) james_w: let's get started
(12:01:50 PM) james_w: who's here for some bzr love?
(12:02:37 PM) ktenney: indeed
(12:02:48 PM) Serdar: bizar love sounds funny, I'm in
(12:03:17 PM) james_w: cool
(12:03:27 PM) james_w: hi everyone, thanks for coming
(12:03:49 PM) james_w: my name is James Westby, I'm going to talk about using bzr for your packaging work
(12:04:10 PM) james_w: I'm going to go over some of the basics, and you can play along at home
(12:04:57 PM) james_w: if you're interested in bzr for packaging then there will be loads of cool stuff happening over the next few months, so keep an eye out
(12:05:24 PM) james_w: if I'm going to fast, or I don't explain something well enough then please yell and let me know
(12:05:43 PM) james_w: first of all we need to install the necessary tools
(12:05:59 PM) james_w: what release of Ubuntu is everyone running?
(12:06:09 PM) Bijoy: Hardy
(12:06:10 PM) swingnjazz: 8.04
(12:06:12 PM) Oli``: 810
(12:06:12 PM) azmodie: hardy
(12:06:16 PM) james_w: if you are on Intrepid then "sudo aptitude install bzr-builddeb" is enough
(12:06:29 PM) pdragon: 8.04
(12:06:29 PM) james_w: if you on Hardy then "sudo aptitude install bzr"
(12:06:45 PM) james_w: and you will need my PPA enabled to get the bzr-builddeb I will be using in the demonstration.
(12:07:28 PM) james_w: < Serdar> +QUESTION: what does bzr stand for? There is lack of information about that at https://wiki.ubuntu.com/UbuntuDeveloperWeek#
(12:07:56 PM) james_w: Serdar: bzr is a version control system, if you want to find out more then you can read bobbo's session from yesterday on bzr
(12:08:32 PM) james_w: those on Hardy will want https://edge.launchpad.net/~james-w/+archive
(12:08:44 PM) james_w: install bzr-builddeb - 2.0~ppa1~hardy1 from there
(12:09:33 PM) james_w: Serdar: https://wiki.ubuntu.com/MeetingLogs/devweek0809/BazaarIntro
(12:09:59 PM) james_w: deb http://ppa.launchpad.net/james-w/ubuntu hardy main
(12:10:08 PM) james_w: that's the sources.list line for hardy users
(12:10:27 PM) james_w: then "sudo aptitude update; sudo aptitude install bzr-builddeb=2.0~ppa1~hardy1"
(12:10:48 PM) james_w: then remove the line from your sources.list again so you don't accidentally install something else from there
(12:11:19 PM) james_w: on Monday the unstoppable dholbach gave a Packaging 101 session where he looked at the hello-debhelper package
(12:11:32 PM) james_w: you can find the log of the session at https://wiki.ubuntu.com/MeetingLogs/devweek0809/Package
(12:11:48 PM) james_w: I've prepared a small branch of this package for us to play with today
(12:12:24 PM) james_w: so once you have all of the tools installed then please run "bzr branch lp:~james-w/+junk/hello-debhelper"
(12:12:50 PM) james_w: you will get a new directory called "hello-debhelper" if you look in there you will see all of the files of the package
(12:13:08 PM) james_w: if you run "bzr log" in the directory you can see that this is a bzr branch with a couple of revisions
(12:13:17 PM) james_w: shout out once you've got that
(12:13:24 PM) nasam: Jep, got that
(12:13:27 PM) ***Oli`` shouts
(12:13:33 PM) kaaloo: got it
(12:13:53 PM) james_w: nice work
(12:15:37 PM) james_w: right, I've just pushed a new revision to my branch for us to play with, so please run "bzr pull" from the hello-debhelper directory
(12:16:00 PM) james_w: it should tell you that you have a new revision
(12:16:12 PM) james_w: if you run "bzr log" now you will see an extra revision
(12:16:29 PM) james_w: to look at the change that I made run "bzr diff -r2..3"
(12:16:41 PM) james_w: which means "show me the changes between revisions 2 and 3"
(12:16:57 PM) james_w: you'll see that I made a small change to the packaging
(12:17:10 PM) james_w: now, it's your turn
(12:18:16 PM) james_w: open "src/hello.c" in your favourite editor
(12:18:29 PM) james_w: and find the bit that prints "Hello, world!" in a box
(12:18:38 PM) james_w: line 115
(12:18:47 PM) james_w: and edit it to say hello to you instead
(12:18:49 PM) james_w: win 14
(12:19:04 PM) james_w: oops
(12:19:05 PM) chombium: <chombium> QUESTION: bzr pull returned: No revisions to pull.
(12:19:24 PM) james_w: chombium: what does "bzr revno" say for you?
(12:19:38 PM) chombium: 3
(12:20:16 PM) chombium: but I got revision 2 and 3 with bzr log
(12:20:51 PM) chombium: seems it's ok
(12:21:07 PM) james_w: chombium: that's ok, you just grabbed the branch after I had done the push, it won't make a difference
(12:21:26 PM) james_w: once you've changed the greeting to say hello to you then save the file and run
(12:21:29 PM) james_w: bzr commit
(12:21:45 PM) james_w: this will open an editor window in which you should type your commit message
(12:21:49 PM) james_w: something like
(12:22:02 PM) james_w: Changed the greeting to say "hello" to me
(12:22:09 PM) james_w: give me a shout once you've done it
(12:22:17 PM) ktenney: ok
(12:22:21 PM) pdragon: done
(12:22:28 PM) nasam: done
(12:22:29 PM) kaaloo: ok
(12:22:32 PM) swingnjazz: done
(12:22:42 PM) mok0: !!!
(12:22:51 PM) albert23: done
(12:22:53 PM) Ampelbein: !!!
(12:22:56 PM) bobbo: done
(12:23:01 PM) james_w: great
(12:23:22 PM) james_w: at this point you could push your work to launchpad, but it's not necessary for this demonstration so we won't
(12:23:46 PM) chombium: done
(12:23:52 PM) james_w: instead I've got a change to the package that I propose you make in your branch
(12:24:03 PM) james_w: I've put this on launchpad for you to look at
(12:24:20 PM) james_w: so, you can "merge" this change, and review it, and decide if it is good or not
(12:24:44 PM) james_w: if you run "bzr merge lp:~james-w/+junk/hello-debhelper-proposed"
(12:24:55 PM) james_w: it will download my changes and try and merge them in to yours
(12:25:25 PM) james_w: < mok0> +QUESTION: what would happen if we push the new version?
(12:25:50 PM) james_w: mok0: you wouldn't be able to push to the location that you got the code from as only I can
(12:26:02 PM) mok0: ok
(12:26:19 PM) james_w: you could push to a location that you own, and then either ask me to merge your changes, or simply keep a branch of your own to experiment with for a while
(12:27:49 PM) james_w: I see some of you have done the merge and have noticed a conflict
(12:28:24 PM) james_w: if you run bzr diff you will be able to see my changes
(12:28:48 PM) james_w: at the bottom you can see that I added a message about bzr.
(12:29:20 PM) james_w: as you didn't change anything in this area there was no problem in making that change in your tree, so it didn't cause a conflict
(12:29:41 PM) james_w: however, I changed the message to say my name, and you did the same
(12:30:09 PM) james_w: so we tried to do two different things to the same line, and bzr can't work out what to do
(12:30:16 PM) james_w: so it asks for our help
(12:30:30 PM) james_w: to do that it marks the area conflicted
(12:30:51 PM) james_w: if you try and run "bzr commit" now it won't let you, it tells us to resolve the conflicts first
(12:31:46 PM) james_w: open src/hello.c in your editor again, and find the same line as before
(12:32:10 PM) james_w: you will see your change, with mine below it
(12:32:30 PM) james_w: and <<<<<<<<<< above both >>>>>>>>> below them and ================== in the middle
(12:32:38 PM) james_w: these are "conflict markers"
(12:32:56 PM) james_w: we need to leave the text how we want, and without these markers
(12:33:10 PM) james_w: so you can delete my change, and all of the markers
(12:33:19 PM) james_w: or you could delete yours and leave mine
(12:33:30 PM) james_w: or you could change the message to say hello to both of us
(12:33:38 PM) james_w: or do whatever you want, it's your choice
(12:34:13 PM) james_w: so, fix the conflict however you like, and then save the file and run "bzr diff"
(12:34:23 PM) james_w: if you pastebin the output I will review it for you
(12:35:22 PM) ktenney: what about the new hello.c.* files?
(12:35:41 PM) james_w: ktenney: we'll deal with those in a moment
(12:36:25 PM) nasam: http://paste.ubuntu.com/43096/
(12:37:05 PM) james_w: nice work nasam
(12:37:49 PM) azmodie: http://pastebin.com/m54562949
(12:38:35 PM) james_w: azmodie: you kept your change
(12:38:37 PM) james_w: ?
(12:38:50 PM) azmodie: yeah
(12:39:14 PM) james_w: great, so it's not shown in "bzr diff" as those lines are the same as in the last revision you committed
(12:39:41 PM) james_w: ok, so the last step is to tell bzr we are happy with the state of the files now
(12:39:51 PM) james_w: run "bzr resolve src/hello.c"
(12:40:20 PM) ktenney: I kept your change
(12:40:34 PM) james_w: the hello.c.* files that ktenney mentioned should now be automatically removed for you, and you will be allowed to commit
(12:41:09 PM) james_w: "bzr resolve" will resolve all the files that no longer have  conflict markers, so that can be quicker
(12:41:36 PM) james_w: once you've done that please commit
(12:42:17 PM) james_w: whenever you do a merge you should review the changes, as even when bzr doesn't mark any files conflicted you may not want all of the changes
(12:42:36 PM) james_w: now we can try building the package
(12:42:55 PM) james_w: that's why we installed bzr-builddeb, as it makes this easy
(12:43:11 PM) james_w: run "bzr builddeb" or "bzr bd" for short and you should see it get to work
(12:44:14 PM) james_w: there's more you can do, but now you know how to pass changes to packages around, merge them, deal with conflicts, and then build the packages
(12:44:27 PM) james_w: that's all I wanted to talk about today
(12:44:36 PM) james_w: are there any questions?
(12:44:50 PM) norsetto: see -chat ...
(12:45:01 PM) Oli``: Yeah a few of us are getting "bzr: ERROR: A Debian packaging error occurred: Could not find upstream tarball at ../tarballs/hello-debhelper_2.2.orig.tar.gz"
(12:45:33 PM) james_w: that's a bug in bzr-builddeb that I think I have since fixed
(12:45:45 PM) james_w: can you all try running the command again?
(12:45:55 PM) nasam: Now it works
(12:46:07 PM) james_w: if it doesn't work second time then it's a new bug
(12:46:17 PM) james_w: ok, thanks, that'll be fixed in the next release
(12:46:20 PM) ktenney: dpkg-buildpackage: failure: fakeroot debian/rules binary gave error exit status 2
(12:46:47 PM) mok0: make[1]: *** No rule to make target `distclean'.  Stop.
(12:46:47 PM) mok0: m
(12:47:04 PM) azmodie: i had same error but adding the deb source ppa solved it. trying to download origional src ppa: deb-src http://ppa.launchpad.net/james-w/ubuntu hardy main
(12:47:21 PM) james_w: they sound like problems with the package
(12:47:42 PM) mok0: Let's fix it, then
(12:47:56 PM) james_w: I'm not the person to teach you about packaging :-)
(12:48:08 PM) azmodie: ls
(12:49:01 PM) james_w: mok0: I'm not sure why that's failing the build, it should be a non-fatal error
(12:49:54 PM) mok0: yeah
(12:51:02 PM) james_w:  < norsetto> +QUESTION: can bzr bd work with pbuilder?
(12:51:34 PM) james_w: if you use plain pbuilder then "bzr bd --builder pdebuild" might do what you want
(12:52:00 PM) james_w: I need to work out how to make it play better with things like pbuilder-dist and sbuild though
(12:52:36 PM) james_w: what I do for now is build a source package ("bzr bd -S") and then call pbuilder-dist myself
(12:52:58 PM) james_w: < kaaloo> +QUESTION : You would still have to update the changelog beforehand ?
(12:53:14 PM) james_w: kaaloo: yes, you still have to do the changelog stuff yourself.
(12:53:31 PM) james_w: < mok0> +QUESTION: Is there a manpage for bzr bd?
(12:54:00 PM) james_w: mok0: no, but "bzr help bd" might help
(12:54:19 PM) james_w: also check /usr/share/doc/bzr-builddeb/ for the user manual
(12:54:29 PM) james_w: any last questions, as we are almost out of time
(12:54:35 PM) ***dholbach hugs james_w
(12:54:48 PM) james_w: hey dholbach, I wondered where you were
(12:54:52 PM) ***james_w hugs dholbach 
(12:55:12 PM) james_w: < mok0> +QUESTION: is bzr bd and bzr-buildpackage the same program being run?
(12:55:56 PM) james_w: mok0: yes, bzr-buildpackage just execs "bzr bd", it's there more to try and help people find the command
(12:56:09 PM) mok0: ok
(12:56:20 PM) james_w: right, thanks all
(12:56:43 PM) james_w: if you want more then you can talk to me at any time
(12:56:46 PM) chombium: thank you james
(12:56:46 PM) james_w: and remember
(12:56:49 PM) james_w: bzr rocks
(12:56:50 PM) mok0: Thanks james_w!!
(12:57:01 PM) swingnjazz: well done, james_w :)
(12:57:11 PM) Coper: thanks james_w
(12:57:12 PM) bobbo: thanks james_w!
(12:57:16 PM) dholbach left the room (quit: "Ex-Chat").
(12:57:16 PM) Ampelbein: thanks james_w!
(12:57:17 PM) azmodie: thanks james_w
(12:57:24 PM) pdragon: thanks!
(12:58:08 PM) james_w: thanks all

MeetingLogs/devweek0809/BZRPackage (last edited 2008-09-03 19:52:30 by pool-68-238-87-204)