Patch and bug collaboration: Shuttleworth

There's an interesting write-up of a speech given by Mark Shuttleworth at the Linux Foundation Collaboration Summit here. Basically, he urges cross-distro collaboration on bug tracking and patching, which is certainly a laudable goal.

Here's the response I mailed to his secretary (you know you're too important for your own good when you need a secretary to read your mail...):

Mark, if you really want to help in this area, there's one very simple thing you could do: push for Debian and its derivations to use a better format for patching packages.

Currently, as I'm sure you know, Debian packages basically consist of the original tarball plus one bigass compressed .diff file which contains:

  1. Every single patch
  2. All the stuff to turn the source into a Debian-style package

This is horribly unwieldy and hard to work with. For instance, take a look at the Firefox diff in Feisty:

http://archive.ubuntu.com/ubuntu/pool/main/f/firefox/firefox_2.0.0.4+1-0ubuntu1.diff.gz

would you enjoy trying to isolate a single fix from that?

In the RPM system, there's a spec file which does the actual package building stuff, and several separate patches which are processed by the spec file. In the best case, there'll be a comment in the spec file or the header of the patch to tell you what the patch does. In the worst case, at least the filename of the patch generally gives you a clue (e.g. appname-gcc4-fixes.patch), and at least since each patch is separate, it's easier to check out each one at a time and see what it does.

To compare with the Debian example, here's the SOURCES directory for Firefox in Mandriva SVN:

http://svn.mandriva.com/cgi-bin/viewvc.cgi/packages/cooker/mozilla-firefox/current/SOURCES/

as you can see - there's the original tarball, and all the patches we apply to the build, each one separate and with a useful name. You'd see much the same thing in Fedora's package.

When I'm packaging something and come across an issue that may be fixed in another distro - for e.g., I'm updating an old package and it has problems building with GCC 4 or on x86_64 or something - the top of my list of other distros to check for patches is Fedora and the bottom is Debian (and Ubuntu). Not because Debian / Ubuntu is unlikely to have a patch or because Debian / Ubuntu's patches are bad - this is obviously not the case - but simply because it's so damn hard to isolate patches from Debian-style packages.

Thanks :)

Comments

Abel Cheung wrote on 2007-06-17 10:09:
Things aren't that simple. Whether people roll out a single mega-patch for everything in the world depends on the individual packager instead. In the old days, those stupid (selfish?) Debian people used to merge all patches into a single one, making everybody except themselves unable to work on it at all. Such people still exists, but the number is (fortunately) decreasing. Right now more people opt for putting separate patches under debian/patches/ folder, and use simple patch system for that (every patch placed in that folder is applied automatically). At least more sensible, and not hard to manage (instead of commenting out individual patch in rpm spec file, in deb package people rename the patch instead). But still, to isolate all individual patches, one need to apt-get the source tarball along with the big patch in order to extract everything. And I'd want to condemn the 'standard' debian practice of patching configure script and aclocal.m4 directly, making backporting much more difficult that how it should be.
adamw wrote on 2007-06-17 17:23:
thanks, abel. I've yet to come across a package which uses that style so I didn't know about it :)