[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#593909: debian-policy: Clarifications about the syntax of Debian control files.

Charles Plessy <plessy@debian.org> writes:

> First, as a sidenote, no field specifies that it may not span multiple
> lines. I therefore agree with you that it is an implicit default case,
> and propose to make it explicit in § 5.1 (see below).


> I then looked at which field description specifies that they ‘may span
> multiple lines’. These are the relationship fields (Depends etc., §7.1),
> the Binary field, and the Uploaders field, but only in source package
> control files. The Files and Checksums-* fields, on the other hand are
> described as ‘multiline fields’. Lastly, nothing is specified for the
> Description and Changes fields, perhaps because it is so obvious.

> It looks like ‘may span multiple lines’ means that continuation lines
> are allowed but newlines are not significant, and ‘multiline fields’
> means that continuation lines are allowed and newlines are
> significant. At this point, I am not sure what is expected from the
> parsers: deliver the value of the fields that ‘may span multiple lines’
> with or without newlines? In any casee, I find this similarity of
> terminology very confusing. I therefore propose to replace ‘may span
> multiple lines’ by ‘continuation lines are allowed’ and add it where it
> was implicit, and add ‘continuation lines are allowed and newlines are
> significant’ where needed as well.

Agreed.  This is very confusing right now, and I think your proposed
method of rephrasing is a good one.  Although another approach may be to
introduce the folding terminology from RFC 5322.

The distinction really is that some fields can be folded (Build-*, for
example) and some fields are multi-line (Description, Files).  The
multi-line fields are not folded in the RFC 5322 sense, since you cannot
just remove the newlines and have semantically the same content.  Those
fields (Description, Files) are a separate type of field that RFC 5322
doesn't have.

> I noted another confusing sentence on the subject, in §5.2: ‘Many fields
> are permitted to span multiple lines in <file>debian/control</file> but
> not in any other control file’. Actually, I found this to be true only
> for the Uploaders field.

I believe this is true of all binary relationship fields and all build
relationship fields as well.  The dpkg-dev tools unfold all of those
fields when generating *.dsc, *.changes, and DEBIAN/control files, and
parers of those generated files do not have to cope with folded fields
(and I believe are known *not* to be able to cope with folded fields in
some cases).  We should say that explicitly.

> I propose to replace it by ‘Continuation lines can be permitted for some
> fields in <file>debian/control</file> but not in any other control
> file.’

Sounds okay to me with the above note about possibly wanting to use
folding instead.

Russ Allbery (rra@debian.org)               <http://www.eyrie.org/~eagle/>

Reply to: