Trying patches from fdm's upstream author

When problems occur and we are seeking the assistance of fdm's author,
it is quite common that he has a pretty good idea of what is going on.

In order to cure reported problems, he will ask us to check whether a
change (a diff or patch) to fdm's source code fixes the problem at hand.

Why me?

fdm is a pretty flexible piece of software. It is possible to use it in
a vast array of different setups. While I am indeed using fdm myself it
is quite possible, that your setup is very different from mine. Also, I
might be using another version than you do (that's very very probable,
since I do not use the debian package myself).

If problems are trivial to reproduce, I will do that. Don't worry.

But commonly, it would be a waste of time for me to rebuild your exact
setup. Patches should fix your problem - so you get to try them.

Fine, you lazy bum. How?

Trying patches involves, you guessed it, recompiling fdm.
But don't worry, fdm is a small and fairly simple package. Recompiling
doesn't take forever and is not hard if you follow these instructions.

To be able to compile fdm, you need to make sure you got all build
dependencies installed:

% apt-get build-dep fdm

Also, install the 'devscripts' package (via aptitude, apt-get or whatever
method you prefer) to get the debuild program used later on.

Then, you'll need to find out what version of fdm you are using.
Issuing this command will tell you:

% dpkg -l fdm

Now you'll need the source code of that version plus its debian specific
changes. They live in the files fdm_<version>.orig.tar.gz and
fdm_<version>.diff.gz. You'll need to fetch them from debian's
archive at:

Let's assume you downloaded both files to /tmp/fdm. To create a debianized
source-code tree, do this (using version 1.5-3 in this example):

% cd /tmp/fdm
% tar xvvzf fdm_1.5.orig.tar.gz
% cd fdm_1.5
% gunzip -c ../fdm_1.5-3.diff.gz | patch -p1

That wasn't so hard, was it?

Ok, got the source tree. How to try the patch?

I will have send a cleaned up patch to you if I directed you to this
place. Use it and not the patch Nicholas sent, because I will have made
sure it is in exactly the format needed to work with quilt.

The fdm package uses quilt to modify the code before compiling. You don't
need to know what quilt is in detail. It is the magic thing that applies
patches located in debian/patches/ named in debian/patches/series before

So to try the patch, copy your cleaned up patch to that directory. Give it
a useful name and append its name to debian/patches/series (ONCE!):

% cp /path/to/my/patch.diff debian/patches/99-test-00.diff
% echo 99-test-00.diff >> debian/patches/series

Using a name like 99-test-00.diff gives you the freedom to apply multiple
patches (if that needed) in files named 99-test-01.diff etc.

After all this, the source tree should be ready to build a patched version
of fdm. Just do this:

% debuild

If this fails, please report. It really shouldn't.

If you see a message like this:

debuild: fatal error at line 1245:
running debsign failed

...please ignore it.

If it succeeded, you'll have a new debian package in /tmp/fdm.
You can install it via 'dpkg -i <filename>' and start testing.

If your problem is resolved, report it.

This is all very confusing...

That's unfortunate.

I tried to be as clear as I could. I think I didn't leave out any of the
required steps. Please tell me where you are stuck so I can improve
this page.

I did try the steps described above myself and they worked for me.