aboutsummaryrefslogtreecommitdiffstats
path: root/tools/licensecheck.pl
diff options
context:
space:
mode:
authorDario Lombardo <lomato@gmail.com>2018-03-09 09:50:52 +0100
committerAnders Broman <a.broman58@gmail.com>2018-03-09 11:50:15 +0000
commitfe2355e061845902400ab5e1447a936e727972a5 (patch)
treea07d584d792e17c59eeb5e0c4a2c2072b81e1096 /tools/licensecheck.pl
parentce07a363378acdf838ee2bedae82a955c9a6fdd5 (diff)
licensecheck: handle multiple licenses.
Change-Id: I1df4406e4bfcdcea99dc1c1446f1863c0a4522a0 Reviewed-on: https://code.wireshark.org/review/26386 Reviewed-by: Anders Broman <a.broman58@gmail.com>
Diffstat (limited to 'tools/licensecheck.pl')
-rwxr-xr-xtools/licensecheck.pl14
1 files changed, 13 insertions, 1 deletions
diff --git a/tools/licensecheck.pl b/tools/licensecheck.pl
index 8f049e81f7..807d54681f 100755
--- a/tools/licensecheck.pl
+++ b/tools/licensecheck.pl
@@ -632,7 +632,7 @@ sub parselicense {
$gplver = " (v$1)";
} elsif ($licensetext =~ /SPDX-License-Identifier:\s+GPL-([1-9])\.0\+/i ) {
$gplver = " (v$1 or later)";
- } elsif ($licensetext =~ /SPDX-License-Identifier:\s+LGPL-([1-9])\.0\-or-later/i ) {
+ } elsif ($licensetext =~ /SPDX-License-Identifier:\s+LGPL-([1-9])\.[0-1]\-or-later/i ) {
$gplver = " (v$1 or later)";
}
@@ -707,6 +707,10 @@ sub parselicense {
$license = 'MIT/X11 (BSD like)';
}
+ if ($licensetext =~ /SPDX-License-Identifier:\s+ISC/i) {
+ $license = 'ISC';
+ }
+
if ($licensetext =~ /(?:is|may be)\s(?:(?:distributed|used).*?terms|being\s+released).*?\b(L?GPL)\b/) {
my $v = $gplver || ' (unversioned/unknown version)';
$license = "$1$v $license";
@@ -845,6 +849,14 @@ sub parselicense {
$license = "WTFPL $license";
}
+ if ($licensetext =~ /SPDX-License-Identifier:\s+\(([a-zA-Z0-9-\.]+)\s+OR\s+([a-zA-Z0-9-\.]+)\)/i) {
+ # print STDERR "OK ---$1---$2---";
+ # print "PIPPO " . parselicense("SPDX-License-Identifier: $1") . " E " . parselicense("SPDX-License-Identifier: $2");
+ if ($1 and $2) {
+ $license = parselicense("SPDX-License-Identifier: $1") . " " . parselicense("SPDX-License-Identifier: $2");
+ }
+ }
+
$license = "UNKNOWN" if (!length($license));
# Remove trailing spaces.