Bazaar
Ubuntu Open Week - Bazaar - Robert Collins - Mon, Apr 28, 2008
(05:07:15 PM) james_w: Hi all. (05:07:29 PM) nosrednaekim left the room ("Konversation terminated!"). (05:07:33 PM) james_w: My name is James Westby, and I'm going to talk about using Bazaar for packaging. (05:08:07 PM) james_w: Sorry to all the Kubuntu fans, it seems like there were loads more questions, hopefully the discussion is continuing elsewhere. (05:09:20 PM) james_w: So, first of all, what is Bazaar? Some people may not know. (05:09:51 PM) james_w: Bazaar is a modern, easy to use, version control system. You can find out more at http://bazaar-vcs.org/ (05:10:15 PM) james_w: Why would we want to use Version control for packaging? (05:10:42 PM) james_w: Firstly, this allows us to keep a finer-grained record of the changes that we made when when we were preparing a new version. (05:11:36 PM) james_w: Secondly, it allows us to collaborate with other people much more efficiently, as it makes merging their changes easier. (05:11:45 PM) james_w: <whitenexx> QUESTION: Is bazaar better than subversion? (05:12:36 PM) james_w: whitenexx: Bazaar is what is known as a "distributed" version control system, which means that branching is really easy (05:13:07 PM) james_w: that means that you can make a branch for each new feature, allowing you to commit when a feature is not complete, which makes development more reliable. (05:13:37 PM) james_w: also, as it is distributed you don't need to be in a special blessed group of people with access to commit (05:14:16 PM) james_w: you can use all the features of the version control system on your own, and then send your changes to be committed to the official branch when you are ready. (05:14:53 PM) james_w: the last advantage I'll mention is that you have all the history locally, so you can commit when you have no Internet access. (05:15:16 PM) james_w: there's loads more good things, if you want to find out more you can join #bzr and talk about it there. (05:16:10 PM) james_w: back to packaging, I explained a couple of benefits for doing this, let's look at what you actually do. (05:16:52 PM) james_w: The first step is to version the Ubuntu/Debian packaging information so that changes to that are recorded, so you can discover when a dependency was added, or something like that. (05:18:23 PM) james_w: You can move beyond this, and also use a branch of the upstream code, which makes it easier to do things like "cherry-pick" a change from upstream for a stable release. (05:18:37 PM) james_w: <ScottK> QUESTION: Why should I bother with bzr? Why can't Ubuntu use svn or git like everyone else does? (05:19:49 PM) james_w: ScottK: It's possible to use another system, such as svn or bzr, to version control your packaging, I'll explain the reason that I am focusing on bzr in a little while. (05:20:13 PM) james_w: I've outlined some advantages of bzr to svn above. (05:21:33 PM) james_w: bzr and git are much more similar, however, I think that bzr has a much more friendly interface, and should be easier to use. (05:23:17 PM) james_w: So, lets have a look at a sample package that uses bzr. You can view it at https://code.edge.launchpad.net/~james-w/+junk/ssss (05:23:37 PM) james_w: you can use "bzr branch http://bazaar.launchpad.net/~james-w/+junk/ssss" to get the code locally if you like. (05:24:40 PM) james_w: http://bazaar.launchpad.net/~james-w/+junk/ssss/files is the web viewer if you prefer that (05:27:34 PM) james_w: So, you can now use bzr to look at the history, and then work on new versions of the package. (05:27:45 PM) james_w: So, how to build a package using bzr? (05:28:21 PM) james_w: "debuild" tool will work as normal, however you would end up with the .bzr directory in the package, which is not what we want. (05:28:47 PM) james_w: You can get around this by using "debuild -i" (05:29:25 PM) james_w: However, there is another way. I wrote a tool called "bzr-builddeb" that will export the package, and then call debuild for you. (05:29:57 PM) james_w: This may seem like overhead at this point, but bzr-builddeb provides other features as wel. (05:31:07 PM) james_w: If you want to try it out then "apt-get install bzr-builddeb" and try running (05:31:10 PM) james_w: bzr builddeb (05:31:16 PM) james_w: in the code that you grabbed earlier (05:31:48 PM) james_w: (there is a pre-defined alias of "bd" for this, so "bzr bd" works as well, and is quicker to type) (05:32:07 PM) james_w: <xxxYURAxxx> QUESTION: where i can see manual to build deb packeges with bzr-builddeb (05:32:12 PM) james_w: xxxYURAxxx: thanks for asking (05:32:25 PM) james_w: http://jameswestby.net/bzr/builddeb/user_manual/ is the user manual (05:32:47 PM) james_w: it's not complete, but it describes some things quite well. (05:34:28 PM) james_w: bzr-builddeb provides you with a number of ways of working, which can be useful in certain circumstances, but the default is probably the one that you want. (05:35:37 PM) james_w: for instance, it allows you to just version the debian/ directory, and then combines this with the upstream code when building. debuild can't do this, so that's one case where bzr-builddeb is worth having as well as that tool. (05:36:48 PM) james_w: One feature that version control of your packages can help a lot with is importing new versions of the package, or new upstream versions. (05:37:21 PM) james_w: The fact that history is recorded means that the merge that happens here can be much more intelligent and help you out a lot in some cases. (05:38:12 PM) james_w: There are two bzr commands provided by the bzr-builddeb package to do this. The first is ""bzr import-dsc", the second is "bzr merge-upstream" (05:40:08 PM) james_w: so, if we are packaging using bzr in Ubuntu, and Debian isn't using version control for the package, we can import a new upload from Debian using the "import-dsc" command. (05:40:47 PM) james_w: you would be in the branch that you have, and you would run "bzr import-dsc foo_1.2.3-4.dsc" (05:41:22 PM) james_w: this should also work for http:// urls as well, so you can import directly from ftp.debian.org without downloading it if you like. (05:42:58 PM) james_w: now, Ubuntu already has a tool that does this, called merge-o-matic, or MoM for short. (05:43:20 PM) james_w: this actually uses version control ideas to do the work, and so it is very similar. (05:43:43 PM) james_w: however, bzr-builddeb allows you to do it yourself, and for other packages than what merge-o-matic provides. (05:45:10 PM) james_w: The other command is merge-upstream, this means that when you see a new upstream release that you want to package you can run the command with the new upstream tarball, and then update the changelog and build. (05:45:20 PM) james_w: If you are happy you can just commit and upload. (05:48:17 PM) james_w: Apologies for not showing you these features in more detail, or talking you through the different modes, I was worried there wouldn't be time if I tried to do that. (05:49:05 PM) james_w: If you are interested I would be happy to talk to you at any other time. (05:49:33 PM) james_w: Does anyone have any more questions now before we wrap up? (05:51:01 PM) mode (+o jcastro ) by ChanServ (05:51:18 PM) jcastro: unless there are more questions I guess we can wrap up? (05:52:01 PM) jcastro: Ok then ... tomorrow at 1500 UTC we start up again (05:52:07 PM) jcastro: https://wiki.ubuntu.com/UbuntuOpenWeek/ (05:52:10 PM) jcastro: there's the schedule (05:52:30 PM) james_w: thanks everyone (05:52:31 PM) jcastro: if you have any comments on how to improve openweek, please feel free to mail me at jorge (at) ubuntu.com (05:52:39 PM) james_w: Enjoy the rest of open week (05:52:41 PM) jcastro: thanks james_w!
MeetingLogs/openweekhardy/Bazaar (last edited 2008-08-06 16:23:47 by localhost)