Subject: | Bug(s) in license_from() |
(I'm actually using 0.67, but it isn't listed in the "Broken in" list.)
The license_from() function contains the following code:
-----
if (
$self->_slurp($file) =~ m/
(
=head \d \s+
(?:licen[cs]e|licensing|copyright|legal)\b
.*?
)
(=head\\d.*|=cut.*|)
\z
/ixms
)
{
my $license_text = $1;
-----
Surely that "(=head\\d.*|=cut.*|)" is a typo? As it stands, it clearly
doesn't spot the end of the POD section that it has picked up, and the
whole of the rest of the file ends up in $license_text!
Presumably it was meant to say "(=head \d.*|=cut.*|)" instead?
But then I find that things don't work correctly in my modules (which
I'm currently trying to upgrade the Module-Install components of).
Consider Win32-UTCFileTime. The POD currently contains the following
near the end of the file:
-----
=head1 COPYRIGHT
Copyright (C) 2003-2007 Steve Hay. All rights reserved.
Portions Copyright (C) 2001 Jonathan M Gilligan. Used with permission.
Portions Copyright (C) 2001 Tony M Hoyle. Used with permission.
=head1 LICENCE
This module is free software; you can redistribute it and/or modify it
under the
same terms as Perl itself, i.e. under the terms of either the GNU
General Public
License or the Artistic License, as specified in the F<LICENCE> file.
-----
If I run M-I 0.67 as it stands then everything from "=head1 COPYRIGHT"
to the end of the file is picked up and I get the warning about "All
rights reserved" having been seen.
If I fix "(=head\\d.*|=cut.*|)" to "(=head \d.*|=cut.*|)" in the code
above and try again then now it only picks up the COPYRIGHT section, not
the LICENCE section that follows it, and complains that it "Cannot
determine license info" (and doesn't print the warning about "All rights
reserved" either, despite that being in the COPYRIGHT section that it
found!)
If I also swap around the order of my COPYRIGHT and LICENCE sections
then M-I is now happy when it shouldn't be: This time it only picks up
the LICENCE section, so it finds license info, but doesn't see the "All
rights reserved" in the COPYRIGHT section!
I guess license_from() wasn't expecting to find separate COPYRIGHT and
LICENCE sections. Can this be sorted out (as well as the "head\\d" bug
above)?
Btw, I also notice that many of the .pm files in Module-Install itself
say "All rights reserved", despite its claim to be under the same terms
as perl itself:
C:\Temp\Module-Install-0.67>\cygwin\bin\grep -lr "All rights reserved" *
Changes
README
inc/Module/Install/Metadata.pm
lib/Module/Install/Can.pm
lib/Module/Install/Deprecated.pm
lib/Module/Install/External.pm
lib/Module/Install/Metadata.pm
lib/Module/Install/PAR.pm
lib/Module/Install/Philosophy.pod
lib/Module/Install/Share.pm
Actually, loads of files in the perl distribution itself say "All rights
reserved" anyway. Where did you get your information that this phrase
causes problems?
I had a quick look around on www.opensource.org for help but couldn't
see anything in particular. I did, however, notice that various OSI
approved licences contain the "All rights reserved" phrase anyway,
include the widely used BSD-style licence:
http://www.opensource.org/licenses/bsd-license.php