| Index: tools/licenses.py
|
| diff --git a/tools/licenses.py b/tools/licenses.py
|
| index b01db489da107bfd599742db55a4bb243c092558..28ffe063b6ac991a20801c5f2769ed9869f6a136 100755
|
| --- a/tools/licenses.py
|
| +++ b/tools/licenses.py
|
| @@ -93,13 +93,13 @@ PRUNE_DIRS = ('.svn', '.git', # VCS metadata
|
| 'layout_tests') # lots of subdirs
|
|
|
| ADDITIONAL_PATHS = (
|
| + os.path.join('googleurl'),
|
| + os.path.join('native_client_sdk'),
|
| # The directory with the word list for Chinese and Japanese segmentation
|
| # with different license terms than ICU.
|
| os.path.join('third_party','icu','source','data','brkitr'),
|
| # Fake directory so we can include the strongtalk license.
|
| os.path.join('v8', 'strongtalk'),
|
| - # Fake directory so we can include the google-url license.
|
| - 'googleurl',
|
| )
|
|
|
|
|
| @@ -116,6 +116,19 @@ SPECIAL_CASES = {
|
| "Name": "Almost Native Graphics Layer Engine",
|
| "URL": "http://code.google.com/p/angleproject/",
|
| },
|
| + os.path.join('third_party', 'cros_system_api'): {
|
| + "Name": "Chromium OS system API",
|
| + "URL": "http://www.chromium.org/chromium-os",
|
| + "License": "BSD",
|
| + # Absolute path here is resolved as relative to the source root.
|
| + "License File": "/LICENSE.chromium_os",
|
| + },
|
| + os.path.join('third_party', 'GTM'): {
|
| + "Name": "Google Toolbox for Mac",
|
| + "URL": "http://code.google.com/p/google-toolbox-for-mac/",
|
| + "License": "Apache 2.0",
|
| + "License File": "COPYING",
|
| + },
|
| os.path.join('third_party', 'lss'): {
|
| "Name": "linux-syscall-support",
|
| "URL": "http://code.google.com/p/lss/",
|
| @@ -124,33 +137,46 @@ SPECIAL_CASES = {
|
| "Name": "OTS (OpenType Sanitizer)",
|
| "URL": "http://code.google.com/p/ots/",
|
| },
|
| + os.path.join('third_party', 'pdfsqueeze'): {
|
| + "Name": "pdfsqueeze",
|
| + "URL": "http://code.google.com/p/pdfsqueeze/",
|
| + "License": "Apache 2.0",
|
| + "License File": "COPYING",
|
| + },
|
| os.path.join('third_party', 'ppapi'): {
|
| "Name": "ppapi",
|
| "URL": "http://code.google.com/p/ppapi/",
|
| },
|
| + os.path.join('third_party', 'scons-2.0.1'): {
|
| + "Name": "scons-2.0.1",
|
| + "URL": "http://www.scons.org",
|
| + "License": "MIT",
|
| + },
|
| + os.path.join('third_party', 'trace-viewer'): {
|
| + "Name": "trace-viewer",
|
| + "URL": "http://code.google.com/p/trace-viewer",
|
| + "License": "BSD",
|
| + },
|
| + os.path.join('third_party', 'v8-i18n'): {
|
| + "Name": "Internationalization Library for v8",
|
| + "URL": "http://code.google.com/p/v8-i18n/",
|
| + },
|
| os.path.join('third_party', 'WebKit'): {
|
| "Name": "WebKit",
|
| "URL": "http://webkit.org/",
|
| + "License": "BSD and GPL v2",
|
| # Absolute path here is resolved as relative to the source root.
|
| "License File": "/webkit/LICENSE",
|
| },
|
| - os.path.join('third_party', 'GTM'): {
|
| - "Name": "Google Toolbox for Mac",
|
| - "URL": "http://code.google.com/p/google-toolbox-for-mac/",
|
| - "License File": "COPYING",
|
| - },
|
| - os.path.join('third_party', 'pdfsqueeze'): {
|
| - "Name": "pdfsqueeze",
|
| - "URL": "http://code.google.com/p/pdfsqueeze/",
|
| - "License File": "COPYING",
|
| - },
|
| - os.path.join('third_party', 'v8-i18n'): {
|
| - "Name": "Internationalization Library for v8",
|
| - "URL": "http://code.google.com/p/v8-i18n/",
|
| + os.path.join('third_party', 'webpagereplay'): {
|
| + "Name": "webpagereplay",
|
| + "URL": "http://code.google.com/p/web-page-replay",
|
| + "License": "Apache 2.0",
|
| },
|
| os.path.join('v8', 'strongtalk'): {
|
| "Name": "Strongtalk",
|
| "URL": "http://www.strongtalk.org/",
|
| + # Absolute path here is resolved as relative to the source root.
|
| "License File": "/v8/LICENSE.strongtalk",
|
| },
|
| }
|
| @@ -194,7 +220,8 @@ def ParseDir(path):
|
| # Try to find README.chromium.
|
| readme_path = os.path.join(path, 'README.chromium')
|
| if not os.path.exists(readme_path):
|
| - raise LicenseError("missing README.chromium")
|
| + raise LicenseError("missing README.chromium or licenses.py "
|
| + "SPECIAL_CASES entry")
|
|
|
| for line in open(readme_path):
|
| line = line.strip()
|
| @@ -236,6 +263,15 @@ def ParseDir(path):
|
| return metadata
|
|
|
|
|
| +def ContainsFiles(path):
|
| + """Determines whether any files exist in a directory or in any of its
|
| + subdirectories."""
|
| + for _, _, files in os.walk(path):
|
| + if files:
|
| + return True
|
| + return False
|
| +
|
| +
|
| def FindThirdPartyDirs():
|
| """Find all third_party directories underneath the current directory."""
|
| third_party_dirs = []
|
| @@ -264,10 +300,17 @@ def FindThirdPartyDirs():
|
| dirs[:] = []
|
| continue
|
|
|
| + # Don't recurse into paths in ADDITIONAL_PATHS, like we do with regular
|
| + # third_party/foo paths.
|
| + if path in ADDITIONAL_PATHS:
|
| + dirs[:] = []
|
| +
|
| for dir in ADDITIONAL_PATHS:
|
| third_party_dirs.append(dir)
|
|
|
| - return third_party_dirs
|
| + # If a directory contains no files, assume it's a DEPS directory for a
|
| + # project not used by our current configuration and skip it.
|
| + return [x for x in third_party_dirs if ContainsFiles(x)]
|
|
|
|
|
| def ScanThirdPartyDirs():
|
|
|