diff options
author | Peter Wu <peter@lekensteyn.nl> | 2018-10-15 22:08:48 +0200 |
---|---|---|
committer | Peter Wu <peter@lekensteyn.nl> | 2018-10-16 08:25:43 +0000 |
commit | 84fd2d79682278927ce07361d901faed35bd1202 (patch) | |
tree | 812afeded7d5d02eb9eeb73e73daa28b077f2f18 /tools | |
parent | 3cb6c95e633019111556706357652304fb8a1139 (diff) |
licensecheck: fix detection of multiple licenses
licensecheck.pl: by the time the second license is evaluated, the $2
variable was already invalidated. Fix that and make it possible for
checklicenses.py to check for multiple license choices.
Change-Id: I8e9e788c33ccd64e85839c82924e28a504f6ae8f
Reviewed-on: https://code.wireshark.org/review/30223
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot
Reviewed-by: Dario Lombardo <lomato@gmail.com>
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
Diffstat (limited to 'tools')
-rwxr-xr-x | tools/checklicenses.py | 43 | ||||
-rwxr-xr-x | tools/licensecheck.pl | 8 |
2 files changed, 5 insertions, 46 deletions
diff --git a/tools/checklicenses.py b/tools/checklicenses.py index 58e75671cd..b52c94627b 100755 --- a/tools/checklicenses.py +++ b/tools/checklicenses.py @@ -108,15 +108,9 @@ PATH_SPECIFIC_WHITELISTED_LICENSES = { 'epan/dfilter/grammar.c': [ 'UNKNOWN', ], - 'epan/dissectors/packet-dtn.c': [ - 'GPL (v2 or later) GPL (v2 or later)' # TODO: make licensecheck handle this better - ], 'epan/dissectors/packet-ieee80211-radiotap-iter.': [ # Using ISC license only 'ISC GPL (v2)' ], - 'epan/dissectors/packet-ppi.c': [ # Using BSD (3 clause) license - 'BSD (3 clause) GPL (v2)' - ], 'plugins/mate/mate_grammar.h': [ 'UNKNOWN', ], @@ -156,40 +150,6 @@ PATH_SPECIFIC_WHITELISTED_LICENSES = { 'ui/gtk/wireshark-gresources.c': [ 'UNKNOWN', ], - # The airpcap code is using BSD (3 clause) - 'epan/crypt/dot11decrypt_interop.h': [ - 'BSD (3 clause) GPL (v2)' - ], - 'epan/crypt/dot11decrypt_tkip.c': [ - 'BSD (3 clause) GPL (v2)' - ], - 'epan/crypt/dot11decrypt_ws.h': [ - 'BSD (3 clause) GPL (v2)' - ], - 'epan/crypt/wep-wpadefs.h': [ - 'BSD (3 clause) GPL (v2)' - ], - 'epan/crypt/dot11decrypt_system.h': [ - 'BSD (3 clause) GPL (v2)' - ], - 'epan/crypt/dot11decrypt_user.h': [ - 'BSD (3 clause) GPL (v2)' - ], - 'epan/crypt/dot11decrypt_ccmp.c': [ - 'BSD (3 clause) GPL (v2)' - ], - 'epan/crypt/dot11decrypt_int.h': [ - 'BSD (3 clause) GPL (v2)' - ], - 'epan/crypt/dot11decrypt.c': [ - 'BSD (3 clause) GPL (v2)' - ], - 'epan/crypt/dot11decrypt_debug.h': [ - 'BSD (3 clause) GPL (v2)' - ], - 'wsutil/dot11decrypt_wep.c': [ - 'BSD (3 clause) GPL (v2)' - ], } def check_licenses(options, args): @@ -252,7 +212,8 @@ def check_licenses(options, args): if 'GENERATED FILE' in license: continue - if license in WHITELISTED_LICENSES: + # Support files which provide a choice between licenses. + if any(item in WHITELISTED_LICENSES for item in license.split(';')): continue if not options.ignore_suppressions: diff --git a/tools/licensecheck.pl b/tools/licensecheck.pl index 807d54681f..ba6dc3e24d 100755 --- a/tools/licensecheck.pl +++ b/tools/licensecheck.pl @@ -850,11 +850,9 @@ sub parselicense { } 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"); - } + my $license1 = $1; + my $license2 = $2; + $license = parselicense("SPDX-License-Identifier: $license1") . ";" . parselicense("SPDX-License-Identifier: $license2"); } $license = "UNKNOWN" if (!length($license)); |