Commit efc8d157 authored by torne@chromium.org's avatar torne@chromium.org

Update webview license tool to match licenses.py.

The FindThirdPartyDirs function no longer filters out empty/missing
directories as of r170273; update webview_licenses to do this. Also,
actually print the name of the directory causing a license error to make
debugging failures easier.

BUG=

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@170736 0039d316-1c4b-4281-b951-d872f2087c98
parent 501f403a
...@@ -58,8 +58,12 @@ def GetIncompatibleDirectories(): ...@@ -58,8 +58,12 @@ def GetIncompatibleDirectories():
if directory in known_issues.KNOWN_ISSUES: if directory in known_issues.KNOWN_ISSUES:
result.append(directory) result.append(directory)
continue continue
metadata = licenses.ParseDir(directory, REPOSITORY_ROOT, try:
require_license_file=False) metadata = licenses.ParseDir(directory, REPOSITORY_ROOT,
require_license_file=False)
except licenses.LicenseError as e:
print 'Got LicenseError while scanning ' + directory
raise
if metadata.get('License Android Compatible', 'no') == 'yes': if metadata.get('License Android Compatible', 'no') == 'yes':
continue continue
license = re.split(' [Ll]icenses?$', metadata['License'])[0] license = re.split(' [Ll]icenses?$', metadata['License'])[0]
...@@ -189,7 +193,8 @@ def _FindThirdPartyDirs(): ...@@ -189,7 +193,8 @@ def _FindThirdPartyDirs():
# Binaries doesn't apply to android # Binaries doesn't apply to android
os.path.join('third_party', 'widevine'), os.path.join('third_party', 'widevine'),
] ]
return licenses.FindThirdPartyDirs(prune_paths, REPOSITORY_ROOT) third_party_dirs = licenses.FindThirdPartyDirs(prune_paths, REPOSITORY_ROOT)
return licenses.FilterDirsWithFiles(third_party_dirs, REPOSITORY_ROOT)
def _Scan(): def _Scan():
......
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