Chromium Code Reviews| Index: tools/licenses.py |
| diff --git a/tools/licenses.py b/tools/licenses.py |
| index 32028aebb4ed902bcde77a8d4daa9b6e9d125d1a..0a812acccfcb07ae16fa02206adf314befb9dddd 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', |
| ) |
| @@ -112,10 +112,30 @@ SPECIAL_CASES = { |
| "URL": "http://code.google.com/p/google-url/", |
| "License File": "LICENSE.txt", |
| }, |
| + 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', '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", |
|
Nico
2012/07/26 19:45:04
nit: It looks like someone tried to keep these ord
Steve Block
2012/07/26 22:11:00
Hmm, they were still out of order, even if conside
|
| + }, |
| os.path.join('third_party', 'angle'): { |
| "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://code.google.com/apis/protocolbuffers", |
|
Nico
2012/07/26 19:45:04
This looks wrong.
Steve Block
2012/07/26 22:11:00
This is from the README, but I guess it's specific
|
| + "License": "BSD", |
| + # Absolute path here is resolved as relative to the source root. |
| + "License File": "/LICENSE.chromium_os", |
| + }, |
| os.path.join('third_party', 'lss'): { |
| "Name": "linux-syscall-support", |
| "URL": "http://code.google.com/p/lss/", |
| @@ -129,6 +149,12 @@ 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/", |
| @@ -138,29 +164,29 @@ SPECIAL_CASES = { |
| "URL": "http://pypi.python.org/packages/source/s/simplejson", |
| "License": "MIT", |
| }, |
| - os.path.join('third_party', 'WebKit'): { |
| - "Name": "WebKit", |
| - "URL": "http://webkit.org/", |
| - # Absolute path here is resolved as relative to the source root. |
| - "License File": "/webkit/LICENSE", |
| + 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', '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', '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', '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", |
| }, |
| } |
| @@ -204,7 +230,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() |
| @@ -246,6 +273,14 @@ def ParseDir(path): |
| return metadata |
| +def ContainsFiles(path): |
| + """Determines whether a directory contains any files.""" |
|
Nico
2012/07/26 19:45:04
"any files in any subdirectory"
Steve Block
2012/07/26 22:11:00
Done.
|
| + 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 = [] |
| @@ -274,10 +309,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(): |