[licensecheck] 53/112: Add group pattern gnu.
Jonas Smedegaard
dr at jones.dk
Fri Nov 25 22:01:50 UTC 2016
This is an automated email from the git hooks/post-receive script.
js pushed a commit to branch master
in repository licensecheck.
commit a52682c126c3abb71cfe5bdbc1bf27ebadad9e79
Author: Jonas Smedegaard <dr at jones.dk>
Date: Fri Sep 23 21:26:03 2016 +0200
Add group pattern gnu.
---
lib/App/Licensecheck.pm | 8 ++------
lib/Regexp/Pattern/License.pm | 9 +++++++++
t/SPDX.t | 1 +
3 files changed, 12 insertions(+), 6 deletions(-)
diff --git a/lib/App/Licensecheck.pm b/lib/App/Licensecheck.pm
index 9b5c4a6..7678834 100755
--- a/lib/App/Licensecheck.pm
+++ b/lib/App/Licensecheck.pm
@@ -469,15 +469,11 @@ sub parse_license
# version of AGPL/GPL
given ($licensetext) {
- when ( /version ($L{re}{version_number})[.,]? (?:\(?only\)?.? )?(?:of the GNU (Affero |Lesser |Library )?General Public License )?(as )?published by the Free Software Foundation/i ) {
+ when ( /version ($L{re}{version_number})[.,]? (?:\(?only\)?.? )?(?:of $L{re}{gnu}|(as )?published by the Free Software Foundation)/i ) {
$gplver = " (v$1)";
@spdx_gplver = ($1)
}
- when ( /GNU (?:Affero |Lesser |Library )?General Public License (?:as )?published by the Free Software Foundation[;,] $L{re}{version}{-keep}\b[.,]? /i ) {
- $gplver = " (v$1)";
- @spdx_gplver = ($1);
- }
- when ( /GNU (?:Affero |Lesser |Library )?General Public License ?(?:[(),AGPL]+) ?$L{re}{version}{-keep}\b[ \.]/i ) {
+ when ( /$L{re}{gnu}\b[;,] $L{re}{version}{-keep}\b[.,]? /i ) {
$gplver = " (v$1)";
@spdx_gplver = ($1);
}
diff --git a/lib/Regexp/Pattern/License.pm b/lib/Regexp/Pattern/License.pm
index cc97843..551b91a 100644
--- a/lib/Regexp/Pattern/License.pm
+++ b/lib/Regexp/Pattern/License.pm
@@ -421,6 +421,8 @@ Patterns each covering multiple licenses.
=item * bsd
+=item * gnu
+
=item * mit
=back
@@ -435,6 +437,13 @@ $RE{'bsd'} = {
qr/$P{repro_notice_cond_discl}(?:(?:[^a-zA-Z]+$P{ad_verbatim}.*)?[^a-zA-Z]+$P{promo_no_author})?/,
};
+$RE{'gnu'} = {
+ name => 'AGPL/GPL/LGPL',
+ summary => 'a GNU license (AGPL or GPL or LGPL)',
+ tags => ['group'],
+ pat => qr/(?:$RE{agpl}{pat}|$RE{gpl}{pat}|$RE{lgpl}{pat})/,
+};
+
$RE{'mit'} = {
name => 'MIT~unspecified',
caption => 'MIT (unspecified)',
diff --git a/t/SPDX.t b/t/SPDX.t
index 38cb542..489a5e0 100644
--- a/t/SPDX.t
+++ b/t/SPDX.t
@@ -11,6 +11,7 @@ $app->deb_fmt(1);
# TODO: make naming scheme configurable
my %Debian2SPDX = (
'AGPL-1' => 'AGPL-1.0',
+ 'AGPL-3' => 'AGPL-3.0',
'AGPL-3+' => 'AGPL-3.0',
'BSD-2-clause' => 'BSD-2-Clause',
'BSD-3-clause' => 'BSD-3-Clause',
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-perl/packages/licensecheck.git
More information about the Pkg-perl-cvs-commits
mailing list