aboutsummaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorGerald Combs <gerald@wireshark.org>2017-11-08 15:43:53 +0000
committerMichael Mann <mmann78@netscape.net>2017-11-09 20:03:51 +0000
commit775bbbcded718ffe6d429bb68e1170b2ef3f7778 (patch)
tree5053c170a675bcce2e0e79b82b3ad10574632e7d /tools
parent50b91d0b4dd057608e521d0a6e82bf08eacff812 (diff)
Start using SPDX license identifiers.
A while back Graham pointed out the SPDX project (spdx.org), which is working on standardizing license specifications: https://www.wireshark.org/lists/wireshark-dev/201509/msg00119.html Appendix V of the specification describes a short identifier (SPDX-License-Identifier) that you can use in place of boilerplate in your source files: https://spdx.org/spdx-specification-21-web-version#h.twlc0ztnng3b Start the conversion process with our top-level C and C++ files. Change-Id: Iba1d835776714deb6285e2181e8ca17f95221878 Reviewed-on: https://code.wireshark.org/review/24302 Reviewed-by: Gerald Combs <gerald@wireshark.org> Petri-Dish: Gerald Combs <gerald@wireshark.org> Reviewed-by: Balint Reczey <balint@balintreczey.hu> Tested-by: Petri Dish Buildbot Reviewed-by: Michael Mann <mmann78@netscape.net>
Diffstat (limited to 'tools')
-rwxr-xr-xtools/licensecheck.pl16
1 files changed, 14 insertions, 2 deletions
diff --git a/tools/licensecheck.pl b/tools/licensecheck.pl
index e5e3597dd4..1df8374777 100755
--- a/tools/licensecheck.pl
+++ b/tools/licensecheck.pl
@@ -20,6 +20,10 @@
# You should have received a copy of the GNU General Public License along
# with this program. If not, see <https://www.gnu.org/licenses/>.
+# Originally copied from Debian's devscripts. A more modern version of
+# this can be found at
+# https://anonscm.debian.org/git/pkg-perl/packages/licensecheck.git/
+
=head1 NAME
licensecheck - simple license checker for source files
@@ -552,7 +556,7 @@ sub clean_cruft_and_spaces {
tr/\t\r\n/ /;
# this also removes quotes
- tr% A-Za-z.,@;0-9\(\)/-%%cd;
+ tr% A-Za-z.+,@:;0-9\(\)/-%%cd;
tr/ //s;
return $_;
@@ -622,9 +626,12 @@ sub parselicense {
$gplver = " (v$1 or later)";
} elsif ($licensetext =~ /GPL\sas\spublished\sby\sthe\sFree\sSoftware\sFoundation,\sversion\s([\d.]+)/i ) {
$gplver = " (v$1)";
+ } elsif ($licensetext =~ /SPDX-License-Identifier:\s+GPL-([1-9])\.0[^+]/i ) {
+ $gplver = " (v$1)";
+ } elsif ($licensetext =~ /SPDX-License-Identifier:\s+GPL-([1-9])\.0\+/i ) {
+ $gplver = " (v$1 or later)";
}
-
if ($licensetext =~ /(?:675 Mass Ave|59 Temple Place|51 Franklin Steet|02139|02111-1307)/i) {
$extrainfo = " (with incorrect FSF address)$extrainfo";
}
@@ -666,6 +673,11 @@ sub parselicense {
$license = "GPL$gplver$extrainfo $license";
}
+ if ($licensetext =~ /SPDX-License-Identifier:\s+GPL/i
+ and length $gplver) {
+ $license = "GPL$gplver$extrainfo $license";
+ }
+
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";