| Index: android_webview/tools/webview_licenses.py
|
| diff --git a/android_webview/tools/webview_licenses.py b/android_webview/tools/webview_licenses.py
|
| index d2775e7fc5d4357a670d40a9ddd300ff2506c34f..b0c4b9c2e8541164ba091ef49a2bcfae5a919a78 100755
|
| --- a/android_webview/tools/webview_licenses.py
|
| +++ b/android_webview/tools/webview_licenses.py
|
| @@ -297,6 +297,13 @@ def GenerateNoticeFile():
|
| return '\n'.join(content)
|
|
|
|
|
| +def _ProcessIncompatibleResult(incompatible_directories):
|
| + if incompatible_directories:
|
| + print ("Incompatibly licensed directories found:\n" +
|
| + "\n".join(sorted(incompatible_directories)))
|
| + return ScanResult.Errors
|
| + return ScanResult.Ok
|
| +
|
| def main():
|
| class FormatterWithNewLines(optparse.IndentedHelpFormatter):
|
| def format_description(self, description):
|
| @@ -308,10 +315,13 @@ def main():
|
| usage='%prog [options]')
|
| parser.description = (__doc__ +
|
| '\nCommands:\n' \
|
| - ' scan Check licenses.\n' \
|
| - ' notice Generate Android NOTICE file on stdout. \n' \
|
| + ' scan Check licenses.\n' \
|
| + ' notice Generate Android NOTICE file on stdout.\n' \
|
| ' incompatible_directories Scan for incompatibly'
|
| - ' licensed directories.')
|
| + ' licensed directories.\n'
|
| + ' all_incompatible_directories Scan for incompatibly'
|
| + ' licensed directories (even those in'
|
| + ' known_issues.py).\n')
|
| (_, args) = parser.parse_args()
|
| if len(args) != 1:
|
| parser.print_help()
|
| @@ -326,13 +336,9 @@ def main():
|
| print GenerateNoticeFile()
|
| return ScanResult.Ok
|
| elif args[0] == 'incompatible_directories':
|
| - incompatible_directories = GetUnknownIncompatibleDirectories()
|
| - if incompatible_directories:
|
| - print ("Incompatibly licensed directories found:\n" +
|
| - "\n".join(sorted(incompatible_directories)))
|
| - return ScanResult.Errors
|
| - return ScanResult.Ok
|
| -
|
| + return _ProcessIncompatibleResult(GetUnknownIncompatibleDirectories())
|
| + elif args[0] == 'all_incompatible_directories':
|
| + return _ProcessIncompatibleResult(GetIncompatibleDirectories())
|
| parser.print_help()
|
| return ScanResult.Errors
|
|
|
|
|