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

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



Le Fri, Sep 24, 2010 at 09:47:49PM -0700, Russ Allbery a écrit :
> 
> That looks mostly right except I think you moved a bit too much.
> 
> > -	  Many fields' values may span several lines; in this case
> > -	  each continuation line must start with a space or a tab.
> > -	  Any trailing spaces or tabs at the end of individual
> > -	  lines of a field value are ignored. 
> > +	  According to the types defined below, fields values may be
> > +	  contained in a logical line that spans several lines.  The
> > +	  lines after the first are called continuation lines and
> > +	  must start with a space or a tab.  Any trailing spaces or tabs
> > +	  at the end of individual lines of a field value are ignored.
> 
> Multiline fields aren't a single logical line that spans several lines.
> They have a value that consists of several lines, both real and logical.
> Only folded fields consist of a single logical line that spans multiple
> lines.

Hi Russ,

I was a bit afraid of receiving this answer. Actually, I made some research
before proposing this wording, to better figure out what a “logical line” is.
Unfortunately, there is not one single defintion. In some cases like the emacs
[Visual Line mode][1], a logical line does not contain newline characters. But
in some other cases like [Python][2], it does, as in the following example
typed in the python interpreter:

>>> '''foo
... bar
... 
... baz'''
'foo\nbar\n\nbaz'
 
[1]: http://www.gnu.org/software/emacs/manual/html_node/emacs/Visual-Line-Mode.html
[2]: http://docs.python.org/reference/lexical_analysis.html#line-structure

The reason why I tried to fit the folded and multiline fields under the same
definition of a logical line is that otherwise there was no definition of how
to construct a multiline field. How about adding ‘Other lines are added
following the same syntax as the continuation lines the folded fields.’ to your
original wording:

	The value of a multiline field may consist of multiple lines.
	The first line of the value, the part on the same line as the
	field name, often has special significance or may have to be
	empty.  Other lines are added following the same syntax as the
	continuation lines the folded fields.  Whitespace, including
	newlines, is significant in the values of multiline fields. 

Have a nice week-end,

-- 
Charles



Reply to: