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

Re: debian/upstream: How to verify valid yaml



Le Wed, Feb 29, 2012 at 08:39:20AM +0100, Andreas Tille a écrit :
> 
> The question is, what we should really do.  Trying to force people to
> learn how to type valid YAML will not increase the acceptance of
> debian/upstream so I would love to keep the current syntax.  If the
> YAML parser of Perl is more relaxed about this syntax I could try to
> find some means to call this as a filter before importing into Python
> (which seems to be necessary for UDD importers.
> 
> Alternatively we at least should enforce people to use quotes around
> titles containing ': ' strings (which works with the Python parser).

Hi Andreas,

thanks to your report I discovered that the YAML parser I used
was accepting contents with invalid syntax.  I reported #661700,
and switched to YAML::XS, which does not accept unquoted field
falues with ambiguous colons.

(Note that the space before the colon in the SeaView was not a syntax
workaround.  Actually I do not remember from where it comes).

In summary, when writing a YAML entry that contains more than just
alphanumeric characters, it is preferrable to either quote it,
or to use YAML's block or folded syntax :

# Invalid
foo: bar:

# Valid
foo: "bar:"

# Also valid
foo: >
 bar:

Also valid
foo: |
 bar:

The difference between | and > is roughly the same as between the multi-line
and folded fields in Debian control files.

Note that despite the bug, because of the round-trip it made in the gatherer,
the data that I serve in http://upstream-metadata.debian.net/~plessy/ is safe.
Another reason for not ignoring it ?

Next I will correct the debian/upstream files in our repositories.  After this,
I will do a mass reload, targetting all of our tasks this time (instead of only
med-bio).

Cheers,

-- 
Charles


Reply to: