## page was renamed from MeetingLogs/devweek1001/devweek1001/BzrAndPkgs == Dev Week -- Bazaar and packaging -- jelmer -- Thu, Jan 28 == UTC {{{#!IRC [19:05] Thanks! [19:05] Hello everybody! [19:06] I'm Jelmer Vernooij, one of the Bazaar developers and an occasional contributor to Debian and Ubuntu [19:06] I'll be leading the next class about packaging with Bazaar [19:07] For this class you will need the bzr-builddeb package [19:09] Today we'll have a look at packaging branches on Launchpad, building packages from a branch and making changes to a packaging branch. [19:10] Is everybody here familiar with Bazaar, or should I give a quick introduction to it as well? [19:11] Great, let's dig into obtaining a packaging branch [19:11] As of a couple of releases ago, Launchpad supports packaging branches [19:11] You can find the packaging branches for a particular package by clicking on "Branches" when viewing a source package on Launchpad [19:13] For example, https://code.edge.launchpad.net/ubuntu/+source/tdb contains the packaging branches for the 'tdb' package [19:14] These branches are different from the upstream branches that live at http://code.launchpad.net/, and contain upstream [19:14] QUESTION: can you clarify what a package branch is, and how it's different from a regular branch [19:15] A package branch is a bzr branch that contains a source package, i.e. the upstream including any changes that have been made to it and the debian/ directory [19:16] Other than the contents there isn't anything special about a packaging branch [19:17] https://code.edge.launchpad.net/ubuntu/+source/tdb lists all of the Ubuntu packaging branches, but James also imports the Debian archive [19:17] for example, you can have a look at https://code.edge.launchpad.net/debian/+source/tdb which contains the Debian packaging branches [19:17] QUESTION: how do you keep the code in a project branch and it's associated package branch in sync? [19:19] You can use the "bzr merge-upstream" package to merge in new upstream tarballs [19:19] This command will also take care of setting the right tags, etc [19:20] But before we get ahead of ourselves.. [19:20] Let's check out the tdb package and try to build it [19:20] If you're familiar with bzr this should be no surprise to you: [19:20] $ bzr branch lp:ubuntu/tdb tdb-lucid [19:21] After this, you should be able to go into the branch and run "bzr builddeb" (or "bzr bd" for short) [19:21] this will export the current working tree and try to build it [19:22] QUESTION: What is the standard naming convention of a bzr ? lp:~ for some and it's lp:/ for some.. [19:22] For upstream branches, it is always ~OWNER/PROJECT/NAME [19:23] for packaging branches, it is ~OWNER/DISTRO/SERIES/PACKAGE/NAME [19:23] but there are some abbreviated names available - if SERIES is the development series, you can get by by just specifying the DISTOR and the PACKAGE [19:24] QUESTION:is there a way to search the lp bzr from cli? [19:25] There is no way to query the lists of branches on Launchpad using the bzr cli at the moment [19:26] Mainly because nobody has had the time to add it yet, patches to add such support would certainly be welcome :-) [19:26] (It should also be possible to run "bzr bd lp:ubuntu/tdb", but I haven't tried that in a while) [19:27] now that we've built the package, let's have a look at making some changes [19:27] The idea is that in the future it will be possible to upload a new version of package simply by pushing to lp:ubuntu/ [19:28] we're not quite there yet, at the moment you will still have to manually build the sourcepackage and upload it. [19:29] (upload it using dput, that is) [19:29] There are importer scripts, run by james_w, that update lp:ubuntu/ to match whatever has been uploaded using ftp. [19:29] QUESTION: my build failed because it couldn't sign the package [19:29] you can use "bzr bd -- -uc -us" to skip the signing, as I assume most of you won't have access to my private GPG key ;-) [19:30] QUESTION: Do ubuntu-stable-release updates work the same way, except one proposes a merge instead of attaching a diff to a bug? [19:31] I'm not familiar with the ubuntu-stable-release process, can somebody else tell perhaps? [19:31] QUESTION: If I want to create a new package branch for a package not yet in Ubuntu, where should I put it? [19:32] That's a good question - at the moment it is not possible to push a new branch for a package that doesn't exist in Ubuntu yet [19:32] So at the moment you will have to wait until the first version of your package has been uploaded before you can push your branches [19:33] Supporting pushing before the upload is something that is on the todo list of the launchpad developers. [19:34] Let's have a look at making a change and preparing an upload. [19:34] Let's make a dummy change, perhaps fixing the outdated docs? [19:34] $ echo "Don't panic." > docs/README [19:34] Next, we should of course update the changelog: [19:35] $ dch -i "Fix the documentation. " [19:35] When we would like to commit this change, the only thing we have to do is run "debcommit" [19:36] $ debcommit [19:37] debcommit will create the commit in Bazaar and will automatically figure out the correct commit message based on the changes to the changelog [19:37] Next, we should be able to build the source package that we'd like to upload [19:37] e.g. "bzr bd -S" (-S for source package) [19:38] QUESTION: why is debcommit separate from the bzr- builddeb commands? [19:38] debcommit is part of the debian developer scripts, and works for a variety of version control systems [19:39] in newer versions of bzr-builddeb you can also use just "bzr commit" [19:39] and bzr will fill in a suggested commit message, similar to the one debcommit uses [19:40] once you have uploaded the package and are happy with it, you should tag the version in bzr by running "bzr mark-uploaded" [19:40] "bzr tags" should list all of the existing tags [19:42] the tags should all you to easily navigate all of the versions of a package using bazaar [19:43] An easy way to browse the history is by using "bzr viz" from the bzr-gtk package [19:43] Another command that is provided by the bzr-builddeb package is "bzr import-dsc" [19:44] This command allows you to import existing tarballs that have been published in the past [19:44] it is the main engine behind the importer scripts that create the branches owned by ~ubuntu-branches [19:45] bzr-builddeb also includes two commands for merging changes into your packaging branch: import-upstream and import-package [19:46] import-upstream allows you to import a new upstream version into your package - you specify a tarball and a version string and it will take care of updating your packaging branch and update a new entry to the debian changelog [19:46] s/update/add/ [19:46] and s/import-upstream/merge-upstream/, obviously - sorry [19:46] merge-package allows you to merge from another packaging branch [19:47] for example, if you need to merge changes from a debian packaging branch you can use merge-package [19:47] among other things, this will take care of merging debian/changelog in a smarter way than "bzr merge" does [19:47] Is everybody keeping up so far? [19:48] merge-package should no longer be necessary after the next bzr release, when "bzr merge" will just Do The Right Thing. [19:49] That concludes what I wanted to talk about - are there any more questions or would you like me to expand on anything? [19:50] QUESTION: I noticed multiple .deb packages were made, does a package branch create more than one package? [19:51] A package branch is like a versioned source package - like a source package multiple binary packages can be created from it [19:52] QUESTION: are there some good resources for someone new to debian packaging to better understand the structure and process? [19:53] You might want to read the log from the getting started session: https://wiki.ubuntu.com/MeetingLogs/devweek1001/GetStarted [19:54] There are also some good resources on the wiki and in the Debian developer corner [19:55] QUESTION: years ago, I think I read 'bazaar' and 'bzr' were two different, closely related programs, maybe forks. Is this true nowadays? Is 'bazaar' exactly the same as 'bzr'? [19:55] The bazaar project has had two different incarnations: "baz" (written in C, derived from arch) and "bzr" (written in Python, from scratch) [19:56] baz used to own the package name "bazaar" but has been removed from the archive now, "bzr" is the current app that we work on. The "bzr baz-import" command can import from old repositories. [19:58] (The developers that used to work on baz all work on bzr these days) [19:59] Any other questions? Feature requests? Rotten tomatoes? [20:00] QUESTION: unrelated, but is there a bzr plugin like mercurial queues? I know about loom, but it doesn't let change the order or patches, etc [20:01] There is also bzr-pipeline, which is similar to but not entirely unlike looms. [20:02] I'm not sure if it supports reordering of patches, but you might want to check it out. [20:02] Thanks for your attention, happy hacking! [20:02] * kfogel claps for jelmer }}}