check for the absence of license notice in headers

This commit is contained in:
Sébastien Loriot 2019-10-20 00:52:57 +02:00
parent fcd0529fb3
commit 5dfd8b753f
1 changed files with 15 additions and 7 deletions

View File

@ -575,16 +575,24 @@ sub parselicense {
$license = "WTFPL $license"; $license = "WTFPL $license";
} }
if ($licensetext =~ /SPDX-License-Identifier GPL-3.0-or-later/i) { # Since SPDX tags are sufficient, make sure no license notice was present
$license = "GPL (v3 or later)"; if (length($license)!=0 && $license ne "GENERATED FILE")
{
$license = $license." READ FROM LICENSE NOTICE THAT SHOULD NOT BE PRESENT";
} }
else
{
if ($licensetext =~ /SPDX-License-Identifier GPL-3.0-or-later/i) {
$license = "GPL (v3 or later)";
}
if ($licensetext =~ /SPDX-License-Identifier LGPL-3.0-or-later/i) { if ($licensetext =~ /SPDX-License-Identifier LGPL-3.0-or-later/i) {
$license = "LGPL (v3 or later)"; $license = "LGPL (v3 or later)";
} }
if ($licensetext =~ /SPDX-License-Identifier LGPL-3.0-only/i) { if ($licensetext =~ /SPDX-License-Identifier LGPL-3.0-only/i) {
$license = "LGPL (v3)"; $license = "LGPL (v3)";
}
} }
$license = "UNKNOWN" if (!length($license)); $license = "UNKNOWN" if (!length($license));