What is MultiDistroTools ?

multidistrotools is a package providing lots of small scripts useful to MOTUs and other Debian derivatives developers. Currently, it particularly targets scripts dealing with lists of packages (all software written in ruby, all science-related software), allowing the user to get a global view of the packages it cares about. But the scope of multidistrotools might be larger in the future.

The multidistrotools package provides /usr/bin/mdt. This executable is a wrapper for a lot of other small scripts which reside in /usr/share/multidistrotools. Those scripts can be run directly, but it is easier to run them through mdt.

More info

Scripts in /usr/share/multidistrotools should do only one thing, but do it well. Scripts longer than 50 lines should really be exceptions.

Scripts in /usr/share/multidistrotools can be written in whatever language one want. However, limiting ourselves to a small set of languages and tools might be a good idea. The packages needed to run those scripts is listed as Recommends, because the user might not want to run all the scripts.

Scripts are coded in a smart way, allowing chaining. They should read their input from stdin as much as possible, and use stdout and stderr' for output.

Currently, multidistrotools depends on ruby, because /usr/bin/mdt is written in this language. However, /usr/bin/mdt is less than 100 lines, so you can rewrite it in python if this dependancy bothers you too much.

TODO / DONE list

Scripts needed:

  • Packages and Sources file management
    • download Packages and Sources files for a distribution (Debian, Ubuntu) and a section (main, contrib, non-free, universe, multiverse) in a local folder (~/.multidistrotools/ ?) done

    • Output those packages files for a distribution (Debian, Ubuntu) and a section (all of them, main, contrib, non-free, universe, multiverse)
    • Get a list of binary/source packages matching something from those Packages or Sources files:
      • Recursive dependancies of something (using Depends, Recommends or Suggests) done: depends (but still need more love to select distribution and dependancy type)

      • Recursive reverse dependancies of something (using Depends, Recommends or Suggests) done: depends

      • Section
      • any grep-dctrl predicate
  • Filter a file containing data with a list of packages done: filter

  • Build a list of binary packages from a list of source packages
  • Build a list of source packages from a list of binary packages done: src2bin

  • Set theory on package lists : union, intersection, difference, substraction, etc. So one can build exactly the list one want. done: list_*

  • Get a list of bugs in the Debian BTS, in the Ubuntu Bugzilla, or in Malone, for a list of packages
  • Compare versions of packages in Debian and Ubuntu
  • Get the popcon results for a list of binary packages. Also for a list of source packages, using the most installed binary package as reference.
  • Generate HTML reports for the list of bugs or the versions of packages
  • Any other cool stuff that you are going to add to this list now

Real life example

(Working with multidistrotools >= 0.0.9)

# because we will generate some temporary files
cd /tmp

# get all packages recursively depending on libruby1.8
mdt depends --reverse libruby1.8 > binpkg

# get the sources packages for those binary packages
mdt bin2src < binpkg > srcpkg

# Update our package lists (Packages and Sources files)
if [ ! -d $HOME/.multidistrotools/sid ]; then
        mdt dist-create sid unstable main contrib non-free
if [ ! -d $HOME/.multidistrotools/dapper ]; then
        mdt dist-create dapper dapper main restricted universe multiverse

mdt dist-apt-get sid update
mdt dist-apt-get dapper update

# Lists versions in Debian and Ubuntu
mdt compare-versions sid dapper > versionslist

# Filter this versions list with the list of ruby-related sources packages
mdt filter srcpkg < versionslist > rubyversionslist

# Generate an HTML report from rubyversionslist
mdt versions2html < rubyversionslist > rubyversionslist.html

Here are some example results.

multidistrotools and motu-tools: what's the difference ?

motu-tools is a set of scripts written by ReinhardTartler, StephanHermann and others. Those scripts (, aims at easing the merge process. At some point, they might (or not) be merged into multidistrotools. This hasn't been discussed yet.

Development info

How can you help ?

  • If you have some personal scripts, start your own branch and add them and ping me
  • Test multidistrotools, report problems, provide ideas for other scripts, etc (all of this will be easier when we will have a package in universe)


  • LucasNussbaum's branch: bzr branch

Building the package

Build the package: dpkg-buildpackage -rfakeroot -us -uc -I.bzr
Read the README if you're interested in adding your scripts.


MultiDistroTools (last edited 2008-08-06 16:18:59 by localhost)