Hi,

On Sun, Nov 21, 2021 at 9:08 AM Yadd <y...@debian.org> wrote:
>
> I wrote some scripts which use Debian::Copyright

Sorry, I did not realize you were referring to functionality provided
by libdebian-copyright-perl.

If you are just extracting information—Lintian does the validation—you
may be better off using a better parser. I could upload mine to the
archive, if you would like to try it. [1] For starters, field names
are case-insensitive (a requirement of the Deb822 spec). There are
also many field extraction functions, such as '->trimmed_list' [2]
(with an optional separator). The way to check for the presence of a
field is with '->declares'. [3] Most significantly, there are no NULL
pointers. [4]

It would be a little bit of a philosophical stretch for Lintian to
alert users to problems with other parsers, rather than the document
itself.

Kind regards
Felix Lechner

[1] Plus two surrounding files,
https://salsa.debian.org/lintian/lintian/-/blob/master/lib/Lintian/Deb822/Section.pm
[2] 
https://salsa.debian.org/lintian/lintian/-/blob/master/lib/Lintian/Check/Team/PkgJs/Testsuite.pm#L55-56
[3] 
https://salsa.debian.org/lintian/lintian/-/blob/master/lib/Lintian/Check/Debian/Copyright/Dep5.pm#L404-408
[4] 
https://www.infoq.com/presentations/Null-References-The-Billion-Dollar-Mistake-Tony-Hoare/

Reply via email to