GoodStuffInUbuntuDevTools

Dev Week -- Good stuff in ubuntu-dev-tools -- bdrung -- Thu, Mar 3rd, 2011

   1 [20:01] <ClassBot> Logs for this session will be available at http://irclogs.ubuntu.com/2011/03/03/%23ubuntu-classroom.html following the conclusion of the session.
   2 [20:01] <bdrung> hi everyone!
   3 [20:01] <bdrung> i am Benjamin Drung, a Debian & Ubuntu-Developer (and a DMB member).
   4 [20:02] <bdrung> In this session I talk about good stuff in ubuntu-dev-tools.
   5 [20:03] <bdrung> I will talk about some old tools, some improved, and some quite new ones.
   6 [20:03] <bdrung> Please feel free to ask any question in #ubuntu-classroom-chat, prefixing them with "QUESTION: " so the bot gets them.
   7 [20:04] <bdrung> 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".
   8 [20:06] <bdrung> 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)
   9 [20:06] <bdrung> Let's start with the first set: pull-*-source
  10 [20:07] <bdrung> There are multiple ways to grab the source package.
  11 [20:08] <bdrung> You can either run "apt-get source <package>", but that's works only if you have the correct distros in your sources.list.
  12 [20:09] <bdrung> Especially if you want to pull the package from an other series or from Debian, it get's complicated.
  13 [20:09] <bdrung> 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.
  14 [20:10] <bdrung> "pull-lp-source vlc lucid" would download the latest source package version of vlc in Ubuntu 10.04 (lucid).
  15 [20:11] <bdrung> "pull-lp-source vlc" would pull the source package from the current Ubuntu development version (natty).
  16 [20:12] <bdrung> "pull-debian-source vlc" would pull the source package from Debian unstable.
  17 [20:12] <bdrung> "pull-debian-source vlc stable" would pull the source package from Debian stable and so on.
  18 [20:12] <bdrung> Questions?
  19 [20:13] <bdrung> The next tool I want to present is suspicious-source.
  20 [20:13] <bdrung> Open a terminal, navigate into an extracted source package and run "suspicious-source" there.
  21 [20:14] <bdrung> 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.
  22 [20:15] <bdrung> It's good for finding pre-compiled or generated files in a source package.
  23 [20:16] <bdrung> I recommend to use for a first check if you package a new software.
  24 [20:16] <bdrung> chadadavis asked: how is this different than branching from bzr?
  25 [20:17] <bdrung> bzr branch and pull-*-source have the same purpose, except bzr gives you a branch and pull-*-source will give you only the tarballs.
  26 [20:18] <bdrung> pull-*-source is the old way, bzr branch is the UDD way
  27 [20:18] <bdrung> Next tools: wrap-and-sort
  28 [20:19] <bdrung> That tools works on the files in debian/ - especially on the control file
  29 [20:19] <bdrung> It work on nearly every kind of list.
  30 [20:20] <bdrung> In debian/control you have a list in the Build-Depends, Depends, Recommends, Suggests, ... fields.
  31 [20:22] <bdrung> These lists are sometimes long and written in one line.
  32 [20:22] <bdrung> There are two problems with such lists:
  33 [20:22] <bdrung> 1. You may have one item twice in the list
  34 [20:23] <bdrung> 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)
  35 [20:24] <bdrung> These points can be addressed if we wrap the list (one item per line; point 2) and sort the list (point 1)
  36 [20:26] <bdrung> Just run "wrap-and-sort" and it will sort these lists. Run "wrap-and-sort -v" to see which files are touched.
  37 [20:26] <bdrung> 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
  38 [20:26] <bdrung> Questions?
  39 [20:27] <bdrung> Not everyone likes the kind of indentation. Run "wrap-and-sort --short-indent" if you want only one space for indentation.
  40 [20:28] <bdrung> Next tools: sponsor-patch
  41 [20:28] <bdrung> This tool is especially interesting for Ubuntu developers with upload right, who want to sponsor someone else.
  42 [20:29] <bdrung> Let's look at http://reports.qa.ubuntu.com/reports/sponsoring/ and pick one item.
  43 [20:29] <bdrung> For example bug #728438.
  44 [20:30] <bdrung> Let's run "sponsor-patch -s 728438"
  45 [20:30] <bdrung> "-s" does the same as "-b -u ubuntu"
  46 [20:31] <bdrung> 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.
  47 [20:32] <bdrung> Before it created the new source tarball, it will run "update-maintainer" and update the timestamp of the changelog entry.
  48 === popey_ is now known as popey
  49 [20:32] <bdrung> It simplifies the bunch of commands that I would have to type otherwise.
  50 [20:33] <bdrung> But it does even more: It makes some sanity checks: Does the changelog automatically close the sponsorship bug?
  51 [20:33] <bdrung> Is the version number greater than the current version in the archive?
  52 [20:34] <bdrung> Is the changelog target valid? E.g. "maverick" is wrong, it must be "maverick-proposed".
  53 [20:35] <bdrung> Then the package will be built (if you have specified -s or -b) with your builder (supported are pbuilder, pbuilder-dist, and sbuild)
  54 [20:36] <bdrung> One correctly built, it will give you the debdiff, the lintian run, and the build log.
  55 [20:36] <bdrung> Once you checked them manually, you can upload it.
  56 [20:37] <bdrung> 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.
  57 [20:38] <bdrung> sponsor-patch works with debdiff, merge proposals (if the have a corresponding bug).
  58 [20:39] <bdrung> 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.
  59 [20:39] <bdrung> You can use sponsor-patch to upload the package to a PPA.
  60 [20:39] <bdrung> Questions?
  61 [20:40] <bdrung> Next tool: backportpackage
  62 [20:40] <bdrung> This tool can be used to backport a package from a later version to an older version.
  63 [20:42] <ClassBot> MadCow108 asked: sponsor-patch does not support cowbuilder? is it planned to add it?
  64 [20:43] <bdrung> I have no plans to add it. Please file a bug report.
  65 [20:44] <bdrung> Bug report can be files either with "ubuntu-bug ubuntu-dev-tools" or on https://bugs.launchpad.net/ubuntu/+source/ubuntu-dev-tools
  66 [20:45] <bdrung> We have a internal interface for the builder. Adding cowbuilder support shouldn't be that hard. We just need someone who tests it. ;)
  67 [20:45] <bdrung> backportpackage and sponsor-patch use the same builder backend and therefore support the same types of builders.
  68 [20:46] <bdrung> backportpackage can build the package with your builder (pbuilder, pbuilder-dist, or sbuild)
  69 [20:47] <bdrung> It can upload the backported package to an PPA or it can do both.
  70 [20:47] <bdrung> Let's give an example: "backportpackage -u ppa:bdrung/backports -b ubuntu-dev-tools"
  71 [20:48] <bdrung> "-u ppa:bdrung/backports" says that backportpackage should upload the backported version to my PPA called backports.
  72 [20:48] <bdrung> "-b" tells it to build the package before the upload.
  73 [20:48] <bdrung> and "ubuntu-dev-tools" is the package to upload.
  74 [20:49] <bdrung> if not specified, the source series is the current development series (natty) and the target series is the running series (determined by lsb-release)
  75 [20:50] <bdrung> If you look at https://launchpad.net/~bdrung/+archive/backports/+packages you will see ubuntu-dev-tools - 0.119~maverick1~ppa1 there.
  76 [20:51] <ClassBot> There are 10 minutes remaining in the current session.
  77 [20:51] <bdrung> You can feed every .dsc file into backportpackage.
  78 [20:52] <bdrung> For example I can backport adblock-plus from Debian unstable:
  79 [20:53] <bdrung> backportpackage -u ppa:mozillateam/xul-ext http://cdn.debian.net/debian/pool/main/a/adblock-plus/adblock-plus_1.3.3-3.dsc
  80 [20:53] <bdrung> Questions?
  81 [20:53] <bdrung> Most of the new tools presented here, were written by tumbleweed and me.
  82 [20:54] <bdrung> Feel free to poke us if you have questions about the script internals.
  83 [20:55] <bdrung> If you were stimulated by this talk, you can look at the package description so see which script are also available.
  84 [20:56] <ClassBot> There are 5 minutes remaining in the current session.
  85 [20:56] <bdrung> 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.
  86 [20:56] <bdrung> Thanks everyone for attending.
  87 [20:57] <bdrung> You can listen to^W^W read more talks tomorrow.

MeetingLogs/devweek1103/GoodStuffInUbuntuDevTools (last edited 2011-03-04 05:08:58 by 111)