Canonical Voices

pitti

(Update: Link to Tomeu’s blog post, repost for planet.gnome.org)

Last week I was in Prague to attend the GNOME/Python 2011 Hackfest for gobject-introspection, to which Tomeu Vizoso kindly invited me after I started working with PyGI some months ago. It happened at a place called brmlab which was quite the right environment for a bunch of 9 hackers: Some comfy couches and chairs, soldering irons, lots of old TV tubes, chips, and other electronics, a big Pirate flag, really good Wifi, plenty of Club Mate and Coke supplies, and not putting unnecessary effort into mundane things like wallpapers.

It was really nice to get to know the upstream experts John (J5) Palmieri and Tomeu Vizoso (check out Tomeu’s blog post for his summary and some really nice photos). When sitting together in a room, fully focussing on this area for a full week, it’s so much easier to just ask them about something and getting things done and into upstream than on IRC or bugzilla, where you don’t know each other personally. I certainly learned a lot this week (and not only how great Czech beer tastes :-) )!

So what did I do?

Application porting

After already having ported four Ubuntu PyGTK applications to GI before (apport, jockey, aptdaemon, and language-selector),
my main goal and occupation during this week was to start porting a bigger PyGTK application. I picked system-config-printer, as it’s two magnitudes bigger than the previous projects, exercises quite a lot more of the GTK GI bindings, and thus also exposes a lot more GTK annotation and pygobject bugs. This resulted in a new pygi s-c-p branch which has the first 100 rounds of “test, break, fix” iterations. It now at least starts, and you can do a number of things with it, but a lot of functionality is still broken.

As a kind of “finger exercise” and also to check for how well pygi-convert works for small projects now, I also ported computer-janitor. This went really well (I had it working after about 30 minutes), and also led me to finally fixing the unicode vs. str mess for GtkTreeView that you got so far with Python 2.x.

pygobject and GTK fixes

Porting system-config-printer and computer-janitor uncovered a lot of opportunities to improve pygi-convert.sh, a big “perl -e” kind of script to do the mechanical grunt work of the porting process. It doesn’t fix up changed signatures (such as adding missing arguments which were default arguments in PyGTK, or the ubiquitous “user_data” argument for signal handlers), but at least it gets a lot of namespaces, method, and constant names right.

I also fixed three annotation fixes in GTK+. We also collaboratively reviewed and tested Pavel’s annotation branch which helped to fix tons of problems, especially after Steve Frécinaux’s excellent reference leak fix, so if you play around with current pygobject git head, you really also have to use the current GTK+ git head.

Speaking of which, if you want to port applications and always stay on top of the pygobject/GTK development without having to clutter your package system with “make install”s of those, it works very well to have this in your ~/.bashrc:

export GI_TYPELIB_PATH=$HOME/projects/gtk/gtk:$HOME/projects/gtk/gdk
export PYTHONPATH=$HOME/projects/pygobject

Better GVariant/GDBus support

The GNOME world is moving from the old dbus-glib python bindings to GDBus, which is integrated into GLib. However, dbus-python exposed a really nice and convenient way of doing D-Bus calls, while using GDBus from Python was hideously complicated, especially for nontrivial arguments with empty or nested arrays:

from gi.repository import Gio, GLib
from gi._gi import variant_type_from_string

d = Gio.bus_get_sync(Gio.BusType.SESSION, None)
notify = Gio.DBusProxy.new_sync(d, 0, None, 'org.freedesktop.Notifications',
    '/org/freedesktop/Notifications', 'org.freedesktop.Notifications', None)

vb = GLib.VariantBuilder()
vb.init(variant_type_from_string('r'))
vb.add_value(GLib.Variant('s', 'test'))
vb.add_value(GLib.Variant('u', 1))
vb.add_value(GLib.Variant('s', 'gtk-ok'))
vb.add_value(GLib.Variant('s', 'Hello World!'))
vb.add_value(GLib.Variant('s', 'Subtext'))
# add an empty array
eavb = GLib.VariantBuilder()
eavb.init(variant_type_from_string('as'))
vb.add_value(eavb.end())
# add an empty dict
eavb = GLib.VariantBuilder()
eavb.init(variant_type_from_string('a{sv}'))
vb.add_value(eavb.end())
vb.add_value(GLib.Variant('i', 10000))
args = vb.end()

result = notify.call_sync('Notify', args, 0, -1, None)
id = result.get_child_value(0).get_uint32()
print id

So I went to making the GLib.Variant constructor work properly with nested types and boxed variants, adding Pythonic GVariant iterators and indexing (so that you can treat GVariant dictionaries/arrays/tuples just like their Python equivalents), and finally a Variant.unpack() method for converting the return value of a D-Bus call back into a native Python data type. This looks a lot friendlier now:

from gi.repository import Gio, GLib

d = Gio.bus_get_sync(Gio.BusType.SESSION, None)
notify = Gio.DBusProxy.new_sync(d, 0, None, 'org.freedesktop.Notifications',
    '/org/freedesktop/Notifications', 'org.freedesktop.Notifications', None)

args = GLib.Variant('(susssasa{sv}i)', ('test', 1, 'gtk-ok', 'Hello World!',
    'Subtext', [], {}, 10000))
result = notify.call_sync('Notify', args, 0, -1, None)
id = result.unpack()[0]
print id

I also prepared another patch in GNOME#640181 which will provide the icing on the cake, i. e. handle the variant building/unpacking transparently and make the explicit call_sync() unnecessary:

from gi.repository import Gio, GLib

d = Gio.bus_get_sync(Gio.BusType.SESSION, None)
notify = Gio.DBusProxy.new_sync(d, 0, None, 'org.freedesktop.Notifications',
    '/org/freedesktop/Notifications', 'org.freedesktop.Notifications', None)

result = notify.Notify('(susssasa{sv}i)', 'test', 1, 'gtk-ok', 'Hello World!',
            'Subtext', [], {}, 10000)
print result[0]

I hope that I can get this reviewed and land this soon.

Thanks to our sponsors!

Many thanks to the GNOME Foundation and Collabora for sponsoring this event!

Read more
pitti

A common source of unnoticed depwaits or uninstallability are main packages which introduce new build or binary dependencies from universe. These either require fixing, or filing a main inclusion report.

To help with this, I added a new check-mir script into ubuntu-dev-tools version 0.110, which walks through all build and binary dependencies, checks if they are in main/restricted, also considers alternative dependencies, and create a report with a few hints.

For a main package where everything is alright, it looks like this:

$ check-mir
Checking support status of build dependencies...

Checking support status of binary dependencies...
All dependencies are supported in main or restricted.

Example output for a totally synthetic situation with universe dependencies, non-preferred alternatives in main, and other special cases:

Checking support status of build dependencies...
 * pmount binary and source package is in universe
  ... alternative libexif-dev is already in main; consider preferring it
 * weechat binary and source package is in universe
 * sendmail-bin is in universe, but its source sendmail is already in main; file an ubuntu-archive bug for promoting the current preferred alternative

Checking support status of binary dependencies...
 * wesnot does not exist (pure virtual?)
 * wesnoth binary and source package is in universe

Please check https://wiki.ubuntu.com/MainInclusionProcess if this source package needs to get into in main/restricted, or reconsider if the package really needs above dependencies.

Read more
pitti

For a test suite I need to create a local SSL-enabled HTTPS server in my Python project. I googled around and found various recipes using pyOpenSSL, but all of those are quite complicated, and I didn’t even get the referenced one to work.

Also, Python has shipped its own built-in SSL module for quite a while. After reading some docs and playing around, I eventually got it to work with a remarkably simple piece of code using the builtin ssl module:

import BaseHTTPServer, SimpleHTTPServer
import ssl

httpd = BaseHTTPServer.HTTPServer(('localhost', 4443), SimpleHTTPServer.SimpleHTTPRequestHandler)
httpd.socket = ssl.wrap_socket (httpd.socket, certfile='path/to/localhost.pem', server_side=True)
httpd.serve_forever()

(I use port 4443 so that I can run the tests as normal user; the usual port 443 requires root privileges).

Way to go, Python!

Read more
pitti

Since last Tuesday, packages built in natty don’t come with a Debian changelog included any more. Due to the continuous demand for downsizing both our installation media, as well as the install footprint, we looked for packages which we should eliminate (duplicate libraries, unnecessary runtimes like our current effort to eliminate perl (-modules, not -base), but also for stuff that users generally don’t need and won’t miss. IMO package changelogs very much fall into the latter category, so they were very high on the “first against the wall” list.

Changelogs are of course a valuable developer tool, but for those it is usually less important to have them available locally, as long as there is a convenient method to access them. For that I wrote a helper tool “apt-changelog” which retrieves it from changelogs.ubuntu.com.

So

$ apt-changelog gnome-panel

now replaces

$ zless /usr/share/doc/gnome-panel/changelog.Debian.gz

apt-changelog is now shipped in apt-utils in Natty.

So far this was discussed pre-UDS on and at UDS in a blueprint and various hallway conversations.

However, there were some concerns, so we got a new compromise to just ship the top 10 changelog records, and add a comment about apt-changelog at the bottom. That way, the most interesting entries are still shipped, and developers and users will get used to “apt-changelog”; this will provide a smoother transition, but still get rid of about 90% of the changelog size. This is implemented by pkgbinarymangler version 81 (just uploaded).

We can re-evaluate this after the next LTS, and eventually drop them completely.

I’ll make sure that by the end of the release all packages that got built between last Tuesday and now will be rebuilt at least once and thus get their changelogs back.

Read more
pitti

After 20 days of final polishing and maturing since the release candidate, the PostgreSQL team released the final 9.0 version today.

Hot off the press, I uploaded postgresql-9.0 final into Debian unstable; they will not go into Debian Squeeze, because Squeeze is frozen and it will take a long time to port all the packaged server side extensions to 9.0.

If you are on Ubuntu 10.04 LTS or Ubuntu 10.10, you can add my PostgreSQL backports for stable Ubuntu releases PPA, which will carry 9.0 until it can be moved to the official Ubuntu backports (i. e. when 9.0 goes into Ubuntu Natty).

Enjoy, and kudos to the PostgreSQL team!

Read more
pitti

For an embedded/thin client project without GNOME, KDE, or even full XFCE I needed a small daemon to automount USB sticks. Using the full gvfs/gdu/nautilus or Thunar stack is too heavyweight for my purposes, but a simple udev rule just doesn’t cut it — I need to mount these USB sticks for a particular user (permissions), and also want to do an action like pop up a window with the contents.

This finally provided me the opportunity to write something bigger than just a 10 line demo in Vala (well, it’s not that much bigger admittedly :-) ). Since that is my first real Vala project, it took quite a lot longer than anticipated; some areas of Vala are still a bit underdocumented, e. g. I spent some half an hour trying to find out how to set a result callback for an asynchronous function invocation. Mikkel Kamstrup Erlandsen suggested to just use a wrapper instead which uses yield, which works fine indeed. Mikkel, thanks for bearing with me!

Anyway, here it is: https://launchpad.net/udisks-automounter, complete with a first release, bzr branch (lp:udisks-automounter), and a package for Ubuntu 10.04 LTS in my PPA.

For avoidance of doubt, this won’t ever make sense on a GNOME/KDE/XFCE desktop, which already have their (much better developed) automounting services. But perhaps it’s useful for someone else with similar constraints.

Read more
pitti

It’s been a decade ago when I did my first steps with contributing to Free Software, about seven years when I joined Debian, and about 6 with Canonical and Ubuntu. Time for some reflection what I have done over these years!

Distribution Packaging and Maintenance

My first sponsored Debian upload ever was cracklib2, which seriously needed some love and was looking for a new maintainer. So in that upload I managed to close all outstanding bugs. Thanks to my mentor Martin Godisch about providing a lot of guidance for this!

Since then I’ve maintained various packages, where the most popular ones are certainly the free database server “PostgreSQL” (see next section) and the e-book management software “Calibre”.

“Maintaining” by and large means “making it really easy to get and use this software”. This decomposes to:

  • Packaging it in a way that a simple apt-get install makes the software work out of the box (as far as possible)
  • Provide a default configuration/customizations so that it integrates and plays well with the rest of the system; this includes the paths and permissions for log files, log rotation, debconf, configuration file standards, etc.
  • Be the front line for bug reports from users, sort, answer, and de-duplicate them, and either fix them myself, or forward useful bugs to upstream.
  • Providing security updates for stable releases
  • To some extent, help with the development of the software; this gets mostly driven by user demand, and of course my personal interests.

In August 2004 I got employed by Canonical to work full time on Ubuntu, which pretty much turned a hobby into a profession. I never regretted this in the past years, it’s an awesome job to do!

In principle I’m doing the same thing in Ubuntu as well: Bring stuff from developers to the people out there. Except with a different focus, in Ubuntu my daily bread and butter is the GNOME desktop and stuff around (and immediately below) it. And even though after a long day of bug triaging and debugging I feel a bit low-hearted (“50.000 bugs away from perfection”), when I take a step back and see how much the usage of Free Software in the world has grown since 2004, I am very proud of being part of Ubuntu, which certainly has its fair contribution and share in this growth. So what seemed like a crazy idea from Mark back in 2004 actually has made a remarkable progress.

In the beginning of Ubuntu I mostly sent back patches to the Debian bug tracker, but this evolved quite a bit on both sides: These days I try to keep “my” packages in sync and commit stuff directly to Debian, which works very well with e. g. the pkg-utopia team, which is responsible for HAL, udisks, upower, PolicyKit, and related packages. At this point I want to thank Michael Biebl for being such an awesome guy on the Debian side! Also, it seems that Debian has moved a fair bit away from the strong “Big Maintainer Lock” towards team based maintenance, so these days it is easier than ever to commit stuff directly to Debian for a lot of packages, without much fuss.

PostgreSQL

I have done a handful of changes to PostgreSQL, but these mostly concerned easy packaging and crash fixes, nothing out of the ordinary. I’m not really a PostgreSQL upstream developer.

The thing I am really proud of is the postgresql-common package, which is a very nice example what a distro can provide on top of upstream: If you install the upstream tarball, you have to manually care for creating clusters, providing a sensible configuration for them, set up SSL, set up log rotation, etc. With postgresql-common, this is all done automatically. The biggest feature it provides is a robust and automatic way of upgrading between major releases with the pg_upgradecluster tool, which takes care of a dozen corner cases and the nontrivial process of dumping the old cluster and reloading the new one. Also, you can effortlessy run several instances of the same version in parallel, so that you can e. g. have a production and a development instance, or try the new 9.0 RC1 while still running the 8.4 production one. (more details)

Crash Reporting with Apport

This has been a pet peeve of mine pretty much from day 1. Back in the old days, crashes in software were a pain to track down: many crashes are hard to reproduce, it takes ages to get useful information from bug reporters, and a lot of data cannot be recovered any more when you try to reproduce and analyze a crash after the fact.

With the growing demand for QA from both Canonical and Ubuntu, in 2006 I finally got some time to start Apport, which would make all this a lot easier: It intercepts crashes as they happen, collects the data that we as a developer need, and makes it very easy for the user to submit them as a bug report. This is accompanied by a backend service (called “retracers”) which would reprocess the bug reports by taking the core dump, reproducing a chroot with the packages and versions that the reporter had, installing the debugging symbols, and re-running gdb, to produce a fully symbolic stack trace.

See this bug report for how this looks like. Since then, tons of crashes were fixed, way more than we could ever have done “the old way” with asking users to rebuild with “-g -O0″, running gdb, etc.

By today, Apport has grown quite a bit: rich bug reports, per-package hooks, automatic duplication of crashes, interactive GUI elements in hooks, etc.

Plumbing Development

Handling hotpluggable hardware has always interested me, since the day when I got my first USB stick and it was ridiculously hard (from an user perspective) to use it:

    $ su -
    # mount -t vfat -o uid=1000 /dev/sda1 /mnt

My first go at this was to write pmount which would allow normal users to mount hotpluggable storage without root privileges and worrying about mount paths and options, and then integrate it into GNOME and HAL. Personally I abandoned it years ago, but it seems other people still use it, so I’m glad that Vincent Fourmond took over the maintenance now.

Since then, the entire stack evolved quite a bit: HAL grew to something useful and rather secure, and finally into some monstrous unmaintainable beast, which is why it was declared dead in 2008, and replaced with the “U” stack: udev, udisks, upower, etc. I enjoy hacking on that a lot, and since it’s part of my Desktop Team Tech Lead/Developer role in Canonical, I can spend some company time on it. so far I worked on bug fixes, small new features, and writing a rather comprehensive test suite for udisks (see my udisks commits so far). I also did a fair share of porting stuff away from HAL to the new stack, including some permanent commitments like maintaining the keymaps in udev.

GNOME

Before I started with Canonical I was never much of a GUI person: I was fully content with fvwm and a few xterms around it. But as an Ubuntu developer I do dogfooding, and thus I switched to GNOME for my day to day work. It didn’t take long before I really fell in love with it!

Similar to my Debian packages, my upstream involvement with GNOME is mostly integration and bug fixing. As already explained, we get a looooot of bug reports, so my focus is mostly on bug fixing. To date, I sent 93 patches to bugzilla. Since January 2010 I became a committer, so that it’s easier for me to get patches upstream.

Debugging problems and fixing bugs is a pretty tedious task, but I still enjoy the rewarding nice feeling when you finally tracked down something and can close a bug with 50 duplicates, and you have made people’s life a little bit easier from now on.

Read more
pitti

Dresden hat Netti und mich wieder! Gestern hat der IC uns und unsere Fahrräder komfortabel wieder von Wien nach Dresden gebracht, nach nur etwas mehr als einer Urlaubswoche.

Wir sind am Freitag den 3. September in Passau gestartet, und dann bis Mittwoch entlang der Donau geradelt. Die Nächte haben wir meistens im Zelt verbracht; der schönste Campingplatz war in Sommerau, quasi bei einer Familie im riesigen Garten:

Schlögener Schlinge Campingplatz Sommerau

Am Mittwoch Mittag sind wir nach 340 Fahrradkilometern dann in der Stadt der k.u.k.-Monarchie, Mozart und Sachertorte angekommen, wo wir fortan in einer Pension im Stadtteil Fünfhaus übernachteten. So haben wir dann den Rest der Zeit bis Freitag abend mit viel Kultur verbracht.

Am Mittwoch nachmittag besuchten wir das Hundertwasserhaus und die dazugehörige Ausstellung. An seinen Bildern haben mich vor allem die fantastisch strahlenden und leuchtenden Farben beeindruckt, dafür hatte Hundertwasser ein göttliches Talent. Sein oft naiver und verspielter, manchmal auch sehr verworrener Malstil ist für mich als Kunstbanausen nicht immer einfach zu interpretieren oder auch nur zu erkennen, aber beeindruckt haben sie mich allemal. Dafür waren die Gaumenfreuden in dem Cafe-Haus am Abend dann umso konkreter – die Wiener Küche und vor allem die süßen und leckeren Nachtische sind einfach Weltklasse!

Der Hofburg und der Innenstadt haben wir den Donnerstag gewidmet, wir haben an diesem Tag die Vorführung der Spanischen Reitschule und dann noch eine Menge Museen geschafft: Schatzkammer, Schmetterlingshaus, Nationalbibliothek, Esperanto- und Globen-Museum, und zu guter Letzt noch den Stephansdom.

Hofburg Schmetterlinge

Nationalbibliothek Stephansdom

Nach einem reichhaltigen Dinner im Restaurant Gutenberg hatten sich unsere Füße erstmal genug erholt, und wir haben uns für die Nacht in Richtung Prater aufgemacht, Wien’s riesigem Vergnügungspark. Auf dem berühmten Riesenrad hat man eine fantastische Sicht über das nächtliche Wien, und konnte sich auch schon mal die teils lustigen, teils wirklich haarsträubenden Attraktionen des Praters anschauen. Wir haben uns auf die beiden Rafting-Bahnen und eine Achterbahn gewagt, und sind zwischendurch noch in ein lustiges Spiegel/Wackelraum/Labyrinth-Kabinett gegangen und haben uns im Bogen- und Luftgewehrschießen geübt.

Prater Prater

Am Donnerstag war dann das Schloss Schönbrunn an der Reihe, der Sitz der k.u.k-Monarchen. Das Schloß selbst ist natürlich schon sehr beeindruckend, bei dem Rundgang haben wir sehr viel über die Geschichte von Franz Josef, Maria Theresia, und der anderen Habsburger erfahren, und einen Eindruck von deren Lebensstil bekommen. Aber auch drumherum gab es viel zu entdecken, im Schloßgelände gibt es einen Irrgarten, einen Zoo, und natürlich auch die Hofbäckerei, wo wir in die Geheimnisse des Wiener Apfelstrudels eingeweiht wurden.

Gloriette

Für Interessierte habe ich die komplette Foto-Galerie hochgeladen.

Read more
pitti

PostgreSQL 9.0 with a whole lot of new features and improvements is nearing completion. The first release candidate was just announced.

As with the beta versions, I uploaded RC1 to Debian experimental again. If you want to test/use them on Ubuntu 10.04 (Lucid Lynx), you can get packages from my “PostgreSQL backports for stable Ubuntu releases” PPA. Please let me know if you need them for other releases.

Just for the records, both Debian 6.0 “Squeeze” and Ubuntu 10.10 “Maverick Meerkat” will release and officially support 8.4 only, as 9.0 is too late for the feature freezes of both. Also, it will take quite some time to update all the packaged extensions to 9.0. As usual, 9.0 will be provided as official backports for both Debian and Ubuntu.

Happy testing!

Read more
pitti

Vor etwa einem Jahr war ich auf meiner ersten Klettersteigtour auf dem Innsbrucker Klettersteig, was mich damals schon recht beeindruckt hat. Dieses Jahr haben wir, d. h. mein Vater, mein Schwager, und ich, die Schwierigkeit um ein oder zwei Stufen erhöht, und sind letzten Samstag auf den Elferkofel geklettert.

Die Tour begann an der Seilbahn-Bergstation in Neustift, wo wir zunächst ein mal eine Handvoll Paraglider-Fans beim konzentrierten Entfitzen und Sortieren der Schnüre und Planen beobachteten. Diesen bunten Schirmen sahen wir tagsüber so ziemlich überall, es muss dort eine prima Thermik herrschen.

Am Anfang stand erst einmal ein etwa 80minütiger strammer Aufstieg, so dass wir beim Beginn der Kletterfelsen schon ganz gut durchgewärmt waren. Wir begannen schon so zeitig wie möglich – die Seilbahn öffnet um 8:30 Uhr – aber die Vorhersagen für den bisher wärmsten Tag des Jahres (bis 38 Grad in München) waren nicht übertrieben, und selbst in so großer Höhe war es noch sehr gut warm.

Dann standen wir vor einer fast senkrechten Wand, wo der Kletterspaß begann. Nun standen etwa vier Stunden Felsen, Seile, Haken, und Ösen vor uns, mit einigen Schwierigkeiten meisterten wir sie alle. Zum Glück waren nicht allzu viele Leute unterwegs, so dass wir uns Zeit lassen konnten. Insbesondere manche Abstiege hatten es ganz schön in sich, ich sympathisiere mit jeder Katze im Baum! Die Aussicht dabei war wieder mal gigantisch: Bizarre Felsen, die manchmal wie willkürlich übereinandergestapelt aussahen und manchmal durch Abstürze in tiefere Felsspalten eingeklemmt waren, und dazwischen vertikale Steilwände. All das umgeben von einem herrlichen Alpen-Gebirgspanorama. Siehe Fotos, Bilder sagen mehr als tausend Worte.

Am Schluss der Elferspitze und des Elferkofels liefen wir dann wieder per pedes den Abstieg zurück zur Seilbahn, wo wir dann gut durchgeschwitzt und fußmüde ankamen. Ach ja, ein Eis und einen kühlen Saft gab es zwischendurch noch auf der Hütte. :-)

Ich freue mich schon auf nächstes Jahr!

Read more
pitti

The Debian import freeze is settled, the first rush of major changes went into Maverick, and the dust now has settled a bit. Thus it’s time to turn back some attention to crashes and quality in general.

This morning I created maverick chroots for the Apport retracers, and they are currently processing the backlog. I also uploaded a new Apport package which now enables crash reporting by default again.

Happy segfaulting!

Read more
pitti

I just learned about vapigen to build a Vala .vapi interface from gobject introspection. Unfortunately it seems that through the way of g-ir-scanner some information gets lost and gir cannot transmit information such as the semantics of arrays (null-terminated or with length, etc.). I played with a “metadata” file for an hour (as described upstream), but it seems to be ignored entirely.

So for now I committed a manually adjusted vapi for gudev. This now makes it easy to write code that queries and listens to udev in Vala.

Small example:

using GUdev;

void
print_device(GUdev.Device d)
{
    stdout.printf("%s ? %s\n", d.get_device_file(), d.get_sysfs_path());
    foreach (string s in d.get_device_file_symlinks())
        stdout.printf("  link: %s\n", s);
}

void
on_uevent(GUdev.Client client, string action, GUdev.Device dev)
{
    stdout.printf("[%s] ", action);
    print_device(dev);
}

int main(string[] args)
{
    var uc = new GUdev.Client({"usb"});

    print_device(uc.query_by_device_file(args[1]));

    stdout.printf("---- all block devices ---\n");
    GLib.List devs = uc.query_by_subsystem("block");
    foreach (GUdev.Device d in devs)
        print_device(d);

    stdout.printf("---- usb events ---\n");
    uc.uevent.connect(on_uevent);
    new GLib.MainLoop().run();
    return 0;
}

Build with valac --pkg gudev-1.0 udev.vala, and perhaps specify --vapidir if you keep the gudev-1.0.vapi file somewhere locally.

Update: I reverted the commit upstream for now, since Vala 0.8 already ships a gudev vapi. I must have overlooked that when I played with vapigen.. In the long run it’s probably better to generate vapis in the projects themselves to avoid API skew, but as long as the vapi can’t be generated automatically it does not make sense to have it in udev. Above code was updated for the vala provided one (which is lacking a return type specification for query_by_subsystem()).

Read more
pitti

I just did the 1000th commit of postgresql-common, the Debian/Ubuntu PostgreSQL management utilities. Wow, what started as a small hack in December 2004 to be able to install several major PostgreSQL versions in parallel has turned out to be a > 600 kB project providing a comprehensive tool set for uniformly setting up, upgrading, and maintaining PostgreSQL database instances from version 7.4 up to the just announced 9.0 beta-1, with a comprehensive test suite that I’m really proud of (it tests just about every aspect, option, and corner case of the installation, integration, upgrade, locale support, and error handling, and takes about half an hour on my system).

The actual commit is rather dull though, it’s just the release/upload tag for version 107 which I just uploaded to Debian unstable (it will hit Ubuntu maverick and backports soon). 107 introduces support for PostgreSQL 9.0, and I fixed up the scripts and tests enough so that all the tests pass now, and thus it’s good for public release.

I also uploaded the 9.0 beta 1 server itself now. It’ll be in Debian’s NEW queue for a bit, and hit experimental in a few days (or hours; recently the ftpmasters have been awesome!) It has a few cool new features (see the announcement), and upstream really appreciates testing and feedback. So, bug reports appreciated!

In particular, if you have existing 8.4 clusters you can just try to pg_upgradecluster them to 9.0 beta 1. Remember, if anything goes wrong, the cluster of the previous version is still intact and untouched, so you can run upgrades as many times as you like and only pg_dropcluster the old one when you’re completely satisfied with the upgrade.

Read more
pitti

Viva Bavaria!

Netti WG-Zimmer

“Grüß Gott!” zusammen aus dem Land südlich des Weißwurstäquators! Auch wenn ich selbige Würste bisher noch nicht verkosten konnte, steht dies ganz oben auf dem Programm!

Ich bin am Samstag gut in München angekommen, wo mich Netti gleich am Hauptbahnhof abgeholt hat. Da wir nun schon mal im Zentrum waren, haben wir die Zeit auch gleich für einen Spaziergang über den Viktualienmarkt und dann für eine Stunde Stadtrundfahrt genutzt, um schon mal einen Überblick zu bekommen. Das richtige bajuvarische Lebensgefühl stellte sich dann im Englischen Garten ein, der bei diesem tollen Sommerwetter natürlich gut gefüllt war. Insbesondere natürlich der Biergarten, mit stimmungsvoller Musik, vielen “Moaß”, und Brezeln die gefühlte 10 Kilo schwer sind (wir haben uns allerdings mit einem Krautsalat und Eis begnügt :-) ).

Nettis WG-Zimmer ist klein aber fein; meine Luftmatratze passt auch perfekt zwischen Bett und Kommode, und sonst ist mittlerweile auch alles drin was rein soll. Dafür ist bei 8 Frauen im Haus auch immer was los! Und es ist richtig schön gelegen, viel Grün in der Nähe in dem man herrlich spazieren und auch laufen gehen kann (Das hab ich heute morgen gleich mal ausprobiert. Wenn man schon mal auf Taekwondo verzichten muss..)

Gestern am Sonntag war es dann so richtig tolles Sommerwetter. Der erste Tag im T-Shirt und Sandalen, juchuu! Wir haben den Zoo besucht, und danach die Auer Dult, ein süßer und gut besuchter Markt mit Volksfest (siehe Fotos).

Zoo Muenchen - Elefant

Ab heute geht es dann wieder etwas mehr seinen gewohnten Gang. Ich habe mir in Nettis Zimmer mein Büro eingerichtet (aka den Laptop aufgeklappt) und bin fleissig dabei, Ubuntu 10.04 den letzten Schliff zu verleihen, bevor es dann am Donnerstag vom Stapel läuft.

Read more
pitti


Es ist mal wieder diese Zeit im Jahr – und diesmal ist es gleich die Grosse Drei-Null, die mich gestern heimsuchte!

Netti hat mir einen gaaanz tollen und leckeren Schokokuchen gebacken, mit weissen Schokoladenplätzchen mit einem Kinderfoto von mir drauf. Über die philosophischen Konsequenzen, seine eigene Jugend aufzuessen, muss ich mir noch tiefere Gedanken machen, zunächst hab ich mir es erstmal schmecken lassen.

Der gestrige Tag ist auch eine gute Gelegenheit für einen Rückblick. In den vergangenen zehn Jahren ist ja doch einiges passiert, einige Höhepunkte die mir einfallen:

  • 2001 hab ich die Frau meines Lebens getroffen. Danke Netti! Ich liebe Dich!
  • 2004 schloss ich mein Informatikstudium mit einem tollen Diplom ab. Ich lernte viele interessante Leute, neue Tätigkeiten, und neues Wissen kennen.
  • Ebenfalls 2004 bekam ich meinen ersten “richtigen” (Vollzeit-)Job bei Canonical, um aus meinem langjährigen Hobby einen Beruf zu machen. Go, Ubuntu, go!
  • 2005 war ich das erste (und bisher einzige) Mal in meinem Leben auf der anderen Seite des Planeten in Sydney, Australien.
  • 2006 habe ich meine erste Taekwondo-Gürtelprüfung bestanden (8. Kup, gelb)
  • 2007 schließlich heiratete ich meine Traumfrau. Danke, Netti!
  • 2009 meine erste Klettersteig-Tour.

Mal sehen, was das nächste Jahrzehnt so bringt. Kinder? Umzug in eine andere Stadt wenn Netti nächstes Jahr mit dem Studium fertig wird? Reicht es noch zum Taekwondo-Meister? Die Zukunft bleibt spannend, und ich freue mich darauf!

Read more
pitti

PostgreSQL did microrelease updates three weeks ago: 8.4.3, 8.3.10, and 8.1.20 are the ones relevant for Debian/Ubuntu. There haven’t been reports about regressions in Debian or the upstream lists so far, so it’s time to push these into stable releases.

The new releases are in Lucid Beta-2, and hardy/jaunty/karmic-proposed. If you are running PostgreSQL, please upgrade to the proposed versions and give feedback to LP #557408.

Updates for Debian Lenny are prepared as well, and await release team ack.

On a related note, I recently fixed quite a major problem in pg_upgradecluster in postgresql-common 106: It did not copy database-level ACLs and configuration settings (Debian #543506). Fixing this required some reenginering of the upgrade process. It’s all thoroughly test case’d, but practical feedback would be very welcome! Remember, if anything goes wrong, the cluster of the previous version is still intact and untouched, so you can run upgrades as many times as you like and only pg_dropcluster the old one when you’re completely satisfied with the upgrade.

Thanks,

Martin

Read more
pitti

Thanks to the work of David Henningsson, we now have a proper Apport symptom for audio bugs. It just got updated again to set default bug titles, which include the card/codec name and the problem, so that Launchpad’s suggested duplicates should work much more reliably.

So from now on you are strongly encouraged to report sound problems with

$ ubuntu-bug audio

instead of trying to guess the package right.

Read more
pitti

I finally listened to Sebastien Bacher and applied for GNOME commit rights yesterday, after hassling Seb once more about committing an approved patch for me. Surprisingly, it only took some 4 hours until my application was approved and my account created, wow! Apparently 71 patches are enough. :-)

With my new powers, I fixed a crash in gdm, and applied two stragglers into gvfs’ build system today.

More to come!

Read more
pitti

These days I often use launchpadlib in my projects for scripting access/modifications in Launchpad. While launchpadlib has quite a good API documentation, this only covers the method calls, not the attributes or collections. So it often takes some poking and trying until you figure out how to access/change things.

I found myself typing the same things over and over, so I finally wrote a little script called lpshell:

#!/usr/bin/python -i
import code, os, sys
from launchpadlib.launchpad import Launchpad, STAGING_SERVICE_ROOT, EDGE_SERVICE_ROOT
lp = Launchpad.login_with('test', STAGING_SERVICE_ROOT)

This logs into Launchpad and gives you an interactive Python shell with an “lp” object:

$ lpshell
>>> lp.bugs[439482].duplicate_of

Update: I committed this to ubuntu-dev-tools now, renamed to lp-shell for consistency with the other lp-* commands.

Read more
pitti

Ich wünsche allen ein gutes, gesundes und erfolgreiches Jahr 2010!

Wir haben gestern mit ein paar Freunden gefeiert. Das neue Jahr haben wir gleich angemessen mit Wunderkerzen begrüßt:

2010!

(Klick auf Bild für größeres Format)

Read more