== Dev Week -- Good stuff in ubuntu-dev-tools -- bdrung -- Thu, Mar 3rd, 2011 == {{{#!irc [20:01] Logs for this session will be available at http://irclogs.ubuntu.com/2011/03/03/%23ubuntu-classroom.html following the conclusion of the session. [20:01] hi everyone! [20:01] i am Benjamin Drung, a Debian & Ubuntu-Developer (and a DMB member). [20:02] In this session I talk about good stuff in ubuntu-dev-tools. [20:03] I will talk about some old tools, some improved, and some quite new ones. [20:03] Please feel free to ask any question in #ubuntu-classroom-chat, prefixing them with "QUESTION: " so the bot gets them. [20:04] ubuntu-dev-tools is a package that contains scripts and tools that are used by Ubuntu developers. You can install it with "sudo apt-get install ubuntu-dev-tools". [20:06] Some tools are quite new and you need to run Ubuntu 11.04 (natty) or grab the latest version from https://code.launchpad.net/~udt-developers/+archive/daily (sorry, only maverick and natty) [20:06] Let's start with the first set: pull-*-source [20:07] There are multiple ways to grab the source package. [20:08] You can either run "apt-get source ", but that's works only if you have the correct distros in your sources.list. [20:09] Especially if you want to pull the package from an other series or from Debian, it get's complicated. [20:09] For that reason we have the pull-*-source tool: pull-lp-source downloads a source package for a given Ubuntu series. pull-debian-source downloads a source package for a given Debian series. [20:10] "pull-lp-source vlc lucid" would download the latest source package version of vlc in Ubuntu 10.04 (lucid). [20:11] "pull-lp-source vlc" would pull the source package from the current Ubuntu development version (natty). [20:12] "pull-debian-source vlc" would pull the source package from Debian unstable. [20:12] "pull-debian-source vlc stable" would pull the source package from Debian stable and so on. [20:12] Questions? [20:13] The next tool I want to present is suspicious-source. [20:13] Open a terminal, navigate into an extracted source package and run "suspicious-source" there. [20:14] The tool will check the mimetype and extension of every file in the directory (and subdirectories) and report the ones that are not known as source files. [20:15] It's good for finding pre-compiled or generated files in a source package. [20:16] I recommend to use for a first check if you package a new software. [20:16] chadadavis asked: how is this different than branching from bzr? [20:17] bzr branch and pull-*-source have the same purpose, except bzr gives you a branch and pull-*-source will give you only the tarballs. [20:18] pull-*-source is the old way, bzr branch is the UDD way [20:18] Next tools: wrap-and-sort [20:19] That tools works on the files in debian/ - especially on the control file [20:19] It work on nearly every kind of list. [20:20] In debian/control you have a list in the Build-Depends, Depends, Recommends, Suggests, ... fields. [20:22] These lists are sometimes long and written in one line. [20:22] There are two problems with such lists: [20:22] 1. You may have one item twice in the list [20:23] 2. Changing one item in the list changes the whole line and it's hard to read a diff then (especially when we merge packages from Debian) [20:24] These points can be addressed if we wrap the list (one item per line; point 2) and sort the list (point 1) [20:26] Just run "wrap-and-sort" and it will sort these lists. Run "wrap-and-sort -v" to see which files are touched. [20:26] One example: Running wrap-and-sort in inkscape gives you these changes: http://bugs.debian.org/cgi-bin/bugreport.cgi?msg=5;filename=wrap-lines.patch;att=1;bug=576357 [20:26] Questions? [20:27] Not everyone likes the kind of indentation. Run "wrap-and-sort --short-indent" if you want only one space for indentation. [20:28] Next tools: sponsor-patch [20:28] This tool is especially interesting for Ubuntu developers with upload right, who want to sponsor someone else. [20:29] Let's look at http://reports.qa.ubuntu.com/reports/sponsoring/ and pick one item. [20:29] For example bug #728438. [20:30] Let's run "sponsor-patch -s 728438" [20:30] "-s" does the same as "-b -u ubuntu" [20:31] Here's what the tools does: It pulls the patch from the bug, it download the corresponding source tarball, applies the patch, created the source tarball. [20:32] Before it created the new source tarball, it will run "update-maintainer" and update the timestamp of the changelog entry. === popey_ is now known as popey [20:32] It simplifies the bunch of commands that I would have to type otherwise. [20:33] But it does even more: It makes some sanity checks: Does the changelog automatically close the sponsorship bug? [20:33] Is the version number greater than the current version in the archive? [20:34] Is the changelog target valid? E.g. "maverick" is wrong, it must be "maverick-proposed". [20:35] Then the package will be built (if you have specified -s or -b) with your builder (supported are pbuilder, pbuilder-dist, and sbuild) [20:36] One correctly built, it will give you the debdiff, the lintian run, and the build log. [20:36] Once you checked them manually, you can upload it. [20:37] If something went wrong or a sanity check failed, you will be asked if you want to fix it. If you say yes, you will get a shell, do your changes, exit with 0, and then it will try again. [20:38] sponsor-patch works with debdiff, merge proposals (if the have a corresponding bug). [20:39] If you feed sponsor-patch a normal patch file, it will apply it with add-patch (another tool in ubuntu-dev-tools). Then you have to write the changelog yourself. [20:39] You can use sponsor-patch to upload the package to a PPA. [20:39] Questions? [20:40] Next tool: backportpackage [20:40] This tool can be used to backport a package from a later version to an older version. [20:42] MadCow108 asked: sponsor-patch does not support cowbuilder? is it planned to add it? [20:43] I have no plans to add it. Please file a bug report. [20:44] Bug report can be files either with "ubuntu-bug ubuntu-dev-tools" or on https://bugs.launchpad.net/ubuntu/+source/ubuntu-dev-tools [20:45] We have a internal interface for the builder. Adding cowbuilder support shouldn't be that hard. We just need someone who tests it. ;) [20:45] backportpackage and sponsor-patch use the same builder backend and therefore support the same types of builders. [20:46] backportpackage can build the package with your builder (pbuilder, pbuilder-dist, or sbuild) [20:47] It can upload the backported package to an PPA or it can do both. [20:47] Let's give an example: "backportpackage -u ppa:bdrung/backports -b ubuntu-dev-tools" [20:48] "-u ppa:bdrung/backports" says that backportpackage should upload the backported version to my PPA called backports. [20:48] "-b" tells it to build the package before the upload. [20:48] and "ubuntu-dev-tools" is the package to upload. [20:49] if not specified, the source series is the current development series (natty) and the target series is the running series (determined by lsb-release) [20:50] If you look at https://launchpad.net/~bdrung/+archive/backports/+packages you will see ubuntu-dev-tools - 0.119~maverick1~ppa1 there. [20:51] There are 10 minutes remaining in the current session. [20:51] You can feed every .dsc file into backportpackage. [20:52] For example I can backport adblock-plus from Debian unstable: [20:53] backportpackage -u ppa:mozillateam/xul-ext http://cdn.debian.net/debian/pool/main/a/adblock-plus/adblock-plus_1.3.3-3.dsc [20:53] Questions? [20:53] Most of the new tools presented here, were written by tumbleweed and me. [20:54] Feel free to poke us if you have questions about the script internals. [20:55] If you were stimulated by this talk, you can look at the package description so see which script are also available. [20:56] There are 5 minutes remaining in the current session. [20:56] Every script in ubuntu-dev-tools has a man page. Some of them give a detailed description what they do, what parameters they take, and some examples. [20:56] Thanks everyone for attending. [20:57] You can listen to^W^W read more talks tomorrow. }}}