Bug#867302: licensecheck: incorrectly parses multi-line copyright notices
Jonas Smedegaard
jonas at jones.dk
Wed Jul 5 19:09:41 UTC 2017
Quoting Ximin Luo (2017-07-05 20:07:00)
> 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!
Thanks!
I thought you wrote you were not into perl ;-)
I will take a closer look and get back to you on this.
- Jonas
--
* Jonas Smedegaard - idealist & Internet-arkitekt
* Tlf.: +45 40843136 Website: http://dr.jones.dk/
[x] quote me freely [ ] ask before reusing [ ] keep private
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: signature
URL: <http://lists.alioth.debian.org/pipermail/pkg-perl-maintainers/attachments/20170705/74fd409a/attachment.sig>
More information about the pkg-perl-maintainers
mailing list