new lintian(1) .changes distribution check

I’m writing this up so I can find it again later, it will affect all of my open source projects (and a few closed source ones, too).

As of Ubunutal Quantal, lintian(1) has added a new test to the things it checks for  in the *.changes file.  It now checks that the Distribution: header contains a known distribution name.Interesting idea, not sure it’s necessary.  But, and this is a big butt, Ubuntu has seen fit to remove all of the upstream Debian names (e.g. “unstable”) from the approved list!?!  The error looks like this:

E: srecord changes: bad-distribution-in-changes-file unstable

I discovered that you can’t pass through the “lintian —dont-check-part=bad-distribution-in-changes-file” option to suppress that one error, because you can only disable all *.changes checks (lintian –dont-check-part=changes-file) or none.  Sheesh.

The fix is tedious.  You need to get -DDistribution=validname  onto the dpkg-genchanges command line.  I did it like this

dpkg-genchanges -DDistribution=`awk -F= '/CODENAME/{print $2}' /etc/lsb-release` blah blah blah

(Hmm, I wonder if deleting that line would also fix it?  That would save having to psychically divine a valid distro release name on an arbitrary Debian derivative.)

Next, you need to get that dpkg-genchanges(1) option passed through by the debuild(1) command, like this:

debuild --changes-option=-DDistribution=`awk -F= '/CODENAME/{print $2}' /etc/lsb-release` yada yada yada

And then you have to get it past make(1) quoting, like this:

debuild --changes-option=-DDistribution=${shell awk -F= '/CODENAME/{print $2}' /etc/lsb-release} yada yada yada

What a comprehensive PITA.

 

Parenthetically, lintian(1) doesn’t apply the same test to the debian/changelog file, which would be an even bigger PITA.  Remind me again why the debian/changelog file even has the distro release name in it?!?