From f8d464f4358649f8a5f80b41a50eafedc612fba5 Mon Sep 17 00:00:00 2001 From: Gerald Combs Date: Mon, 8 Jun 2020 16:19:57 -0700 Subject: checklicenses: Add a --list-allowed option. Add an option to list our allowed licenses. Remove a couple of GTK+ entries while we're here. Change-Id: I1c8cf3314cff369766f1ba25438f16c69f42a1ba Reviewed-on: https://code.wireshark.org/review/37409 Reviewed-by: Alexis La Goutte Reviewed-by: Gerald Combs --- tools/checklicenses.py | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) (limited to 'tools/checklicenses.py') diff --git a/tools/checklicenses.py b/tools/checklicenses.py index dda74ed3ab..3e1b04a5b8 100755 --- a/tools/checklicenses.py +++ b/tools/checklicenses.py @@ -21,6 +21,8 @@ def PrintUsage(): --ignore-suppressions Ignores path-specific allowed license. Useful when trying to remove a suppression/allowed entry. + --list-allowed Print a list of allowed licenses and exit. + tocheck Specifies the directory, relative to root, to check. This defaults to "." so it checks everything. @@ -143,16 +145,13 @@ PATH_SPECIFIC_ALLOWED_LICENSES = { 'tools/licensecheck.pl': [ 'GPL (v2)' ], - # Generated files for GTK pixbuf binary bundling - 'ui/gtk/wireshark-gresources.h': [ - 'UNKNOWN', - ], - 'ui/gtk/wireshark-gresources.c': [ - 'UNKNOWN', - ], } def check_licenses(options, args): + if options.list_allowed: + print('\n'.join(ALLOWED_LICENSES)) + sys.exit(0) + # Figure out which directory we have to check. if len(args) == 0: # No directory to check specified, use the repository root. @@ -250,6 +249,10 @@ def main(): 'will normally be the repository root.') option_parser.add_option('-v', '--verbose', action='store_true', default=False, help='Print debug logging') + option_parser.add_option('--list-allowed', + action='store_true', + default=False, + help='Print a list of allowed licenses and exit.') option_parser.add_option('--ignore-suppressions', action='store_true', default=False, -- cgit v1.2.3