Commit c721e572 authored by mkosiba@chromium.org's avatar mkosiba@chromium.org

Add an option to scan for incompatible folders to the WebView license tool.

This is a prerequisite to adding the incompatible folders check to the
AOSP bot.

BUG=329540
TEST=run tool

Review URL: https://codereview.chromium.org/133073008

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@245560 0039d316-1c4b-4281-b951-d872f2087c98
parent fafdc849
......@@ -34,7 +34,7 @@ import known_issues
def GetIncompatibleDirectories():
"""Gets a list of third-party directories which use licenses incompatible
with Android. This is used by the snapshot tool.
with Android. This is used by the snapshot tool and the AOSP bot.
Returns:
A list of directories.
"""
......@@ -282,8 +282,10 @@ def main():
parser.description = (__doc__ +
'\nCommands:\n' \
' scan Check licenses.\n' \
' notice Generate Android NOTICE file on stdout')
(options, args) = parser.parse_args()
' notice Generate Android NOTICE file on stdout. \n' \
' incompatible_directories Scan for incompatibly'
' licensed directories.')
(_, args) = parser.parse_args()
if len(args) != 1:
parser.print_help()
return ScanResult.Errors
......@@ -296,6 +298,13 @@ def main():
elif args[0] == 'notice':
print GenerateNoticeFile()
return ScanResult.Ok
elif args[0] == 'incompatible_directories':
incompatible_directories = GetIncompatibleDirectories()
if incompatible_directories:
print ("Incompatibly licensed directories found:" +
"\n".join(incompatible_directories))
return ScanResult.Errors
return ScanResult.Ok
parser.print_help()
return ScanResult.Errors
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment