Bug#867302: licensecheck: incorrectly parses multi-line copyright notices

Ximin Luo infinity0 at debian.org
Wed Jul 5 18:07:00 UTC 2017


Ximin Luo:
> Control: tags -1 + patch
> Control: reassign -1 libstring-copyright-perl
> Control: affects -1 + licensecheck
> 
> Looks like I can do this by editing /usr/share/perl5/String/Copyright.pm as follows:
> 
>  		# stringify objects
>  		$copyright = "$copyright";
> +		$copyright =~ s/(,|\band)\s*\n(?:#|\/\/|\/\*)?\s*/$1 /g;
> 
> Please test and apply if it's good!
> 

This breaks some of my test cases; attached is an updated patch. It gives good results for Sage:

$ licensecheck -l200 --copyright src/sage/plot/arrow.py src/sage/combinat/words/paths.py src/sage/sets/finite_set_maps.py src/sage/modular/modform/all.py
src/sage/plot/arrow.py: GPL
  [Copyright: 2006 Alex Clemesha <clemesha at gmail.com>, William Stein <wstein at gmail.com>, 2008 Mike Hansen <mhansen at gmail.com>, 2009 Emily Kirkman]

src/sage/combinat/words/paths.py: GPL (v2 or later)
  [Copyright: 2009 Sebastien Labbe <slabqc at gmail.com>, / 2008 Arnaud bergeron <abergeron at gmail.coms>,]

src/sage/sets/finite_set_maps.py: GPL
  [Copyright: 2010 Florent Hivert <Florent.Hivert at univ-rouen.fr>,]

src/sage/modular/modform/all.py: GPL
  [Copyright: 2004-2006 William Stein <wstein at gmail.com>]

It's a little complicated - it uses replacement expressions. If you can think of a better way of doing it, please let me know!

X

-- 
GPG: ed25519/56034877E1F87C35
GPG: rsa4096/1318EFAC5FBBDBCE
https://github.com/infinity0/pubkeys.git
-------------- next part --------------
A non-text attachment was scrubbed...
Name: copyright.diff
Type: text/x-diff
Size: 1408 bytes
Desc: not available
URL: <http://lists.alioth.debian.org/pipermail/pkg-perl-maintainers/attachments/20170705/c36bbd98/attachment-0001.diff>


More information about the pkg-perl-maintainers mailing list