Re: Comments+blank line in debian/control: Clarification in policy or MBF?
On 2012-10-03 12:02, Michael Tautschnig wrote:
>> On 2012-10-03 11:01, Michael Tautschnig wrote:
>>> But then either all build infrastructure (and also lintian) don't use
>>> debian/control, or all these tools tolerate that blank line (with the exception
>>> of pbuilder).
>> Lintian's parser ignores empty lines before/between paragraphs.
> I suppose that piece of code is quite dated. Is there a way to figure out why
> lintian does this, i.e., who decided to interpret policy in this way?
The code basically the same now as it was in Oct 1998. From the Lintian
changelog, I am guessing the code was written in the 0.3.0 upload (from
March 1st, 1998) or in the 0.4.0 (April 6th, same year). However,
neither change have a bug associated with the changes and I not aware
of any copy of either of those versions still existing.
While I cannot say for certain, I am guessing it is side effect and not
* Internal changes:
- implemented dpkg_read_control to parse all controls
* Internal: fixed bug in read_dpkg_control() utility function: empty
tags have not been handled correctly
If you go hunting for you, it will probably appear in lib/util.pl
(source) or /usr/share/lintian/lib/util.pl (binary).
 My guess is based on the following observation.
The parser is used for signed (and unsigned) control files, so it has
code for handling the presence of the signature. More specifically, it
checks for a line starting with "-----BEGIN PGP" (that isn't "BEGIN PGP
SIGNATURE"). FTR the parser has never enforced that the marker appears
on the first line if at all.
In the current versions it will ignore lines up to the first empty line
after the PGP marker, but in the 0.9.3 version it doesn't. So the 0.9.3
parser would pick up the the "Hash: SHA256" field as the first paragraph
in the following:
-----BEGIN PGP SIGNED MESSAGE-----
Assuming GPG/PGP was not adding fields after the "SIGNED MESSAGE" marker
back then, it would make sense for the code to ignore an empty line
before the first paragraph as a way to handle the empty line after the
"SIGNED MESSAGE" marker.
Indeed, if you look at the Lintian 0.9.3 dsc[LDSC] it does not have any
"GPG fields" in it at the first marker. Instead they appear after the
"SIGNATURE" marker, so that /could/ be the logic behind it.
Oh look, no Build-Depends... XD