summaryrefslogtreecommitdiffstats
path: root/android_webview/tools/webview_licenses.py
diff options
context:
space:
mode:
Diffstat (limited to 'android_webview/tools/webview_licenses.py')
-rwxr-xr-xandroid_webview/tools/webview_licenses.py26
1 files changed, 16 insertions, 10 deletions
diff --git a/android_webview/tools/webview_licenses.py b/android_webview/tools/webview_licenses.py
index d2775e7..b0c4b9c 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