Hi Felix, lintian should provide an error when Debian::Copyright fails and debian/copyright declares to be compatible with https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ Example with salsa.debian.org/js-team/uglifyjs Cheers, Yadd
Hi Yadd, Which failure did you have in mind, please? Lintian parses machine-readable files—which is what uglifyjs ships [1]—in the nearby check Debian::Copyright::Dep5. [2] Thanks! Kind regards Felix Lechner [1] https://tracker.debian.org/media/packages/u/uglifyjs/copyright-2.8.29-8 [2] https://salsa.debian.org/lintian/lintian/-/blob/master/lib/Lintian/Check/Debian/Copyright/Dep5.pm
Hi Yadd, Which failure did you have in mind, please? Lintian parses machine-readable files—which is what uglifyjs ships [1]—in the nearby check Debian::Copyright::Dep5. [2] Thanks! Kind regards Felix Lechner [1] https://tracker.debian.org/media/packages/u/uglifyjs/copyright-2.8.29-8 [2] https://salsa.debian.org/lintian/lintian/-/blob/master/lib/Lintian/Check/Debian/Copyright/Dep5.pm
Le 21/11/2021 à 17:28, Felix Lechner a écrit :
I wrote some scripts which use Debian::Copyright to automatize some JS
things, but when Debian::Copyright is unable to read debian/copyright,
automatic tools fail.
Here is a simple test:
my $c = Debian::Copyright->new();
$c->read('debian/copyright');
Hi, 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/