| OLD | NEW |
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
| 2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
| 4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
| 5 | 5 |
| 6 """Utility for checking and processing licensing information in third_party | 6 """Utility for checking and processing licensing information in third_party |
| 7 directories. | 7 directories. |
| 8 | 8 |
| 9 Usage: licenses.py <command> | 9 Usage: licenses.py <command> |
| 10 | 10 |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 91 os.path.join('sdch', 'open-vcdiff'), | 91 os.path.join('sdch', 'open-vcdiff'), |
| 92 os.path.join('testing', 'gmock'), | 92 os.path.join('testing', 'gmock'), |
| 93 os.path.join('testing', 'gtest'), | 93 os.path.join('testing', 'gtest'), |
| 94 os.path.join('tools', 'grit'), | 94 os.path.join('tools', 'grit'), |
| 95 os.path.join('tools', 'gyp'), | 95 os.path.join('tools', 'gyp'), |
| 96 os.path.join('tools', 'page_cycler', 'acid3'), | 96 os.path.join('tools', 'page_cycler', 'acid3'), |
| 97 os.path.join('url', 'third_party', 'mozilla'), | 97 os.path.join('url', 'third_party', 'mozilla'), |
| 98 os.path.join('v8'), | 98 os.path.join('v8'), |
| 99 # Fake directory so we can include the strongtalk license. | 99 # Fake directory so we can include the strongtalk license. |
| 100 os.path.join('v8', 'strongtalk'), | 100 os.path.join('v8', 'strongtalk'), |
| 101 os.path.join('v8', 'third_party', 'fdlibm'), |
| 101 ) | 102 ) |
| 102 | 103 |
| 103 | 104 |
| 104 # Directories where we check out directly from upstream, and therefore | 105 # Directories where we check out directly from upstream, and therefore |
| 105 # can't provide a README.chromium. Please prefer a README.chromium | 106 # can't provide a README.chromium. Please prefer a README.chromium |
| 106 # wherever possible. | 107 # wherever possible. |
| 107 SPECIAL_CASES = { | 108 SPECIAL_CASES = { |
| 108 os.path.join('native_client'): { | 109 os.path.join('native_client'): { |
| 109 "Name": "native client", | 110 "Name": "native client", |
| 110 "URL": "http://code.google.com/p/nativeclient", | 111 "URL": "http://code.google.com/p/nativeclient", |
| (...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 213 "URL": "http://code.google.com/p/v8", | 214 "URL": "http://code.google.com/p/v8", |
| 214 "License": "BSD", | 215 "License": "BSD", |
| 215 }, | 216 }, |
| 216 os.path.join('v8', 'strongtalk'): { | 217 os.path.join('v8', 'strongtalk'): { |
| 217 "Name": "Strongtalk", | 218 "Name": "Strongtalk", |
| 218 "URL": "http://www.strongtalk.org/", | 219 "URL": "http://www.strongtalk.org/", |
| 219 "License": "BSD", | 220 "License": "BSD", |
| 220 # Absolute path here is resolved as relative to the source root. | 221 # Absolute path here is resolved as relative to the source root. |
| 221 "License File": "/v8/LICENSE.strongtalk", | 222 "License File": "/v8/LICENSE.strongtalk", |
| 222 }, | 223 }, |
| 224 os.path.join('v8', 'third_party', 'fdlibm'): { |
| 225 "Name": "fdlibm", |
| 226 "URL": "http://www.netlib.org/fdlibm/", |
| 227 "License": "Freely Distributable", |
| 228 # Absolute path here is resolved as relative to the source root. |
| 229 "License File" : "/v8/third_party/fdlibm/LICENSE", |
| 230 }, |
| 223 } | 231 } |
| 224 | 232 |
| 225 # Special value for 'License File' field used to indicate that the license file | 233 # Special value for 'License File' field used to indicate that the license file |
| 226 # should not be used in about:credits. | 234 # should not be used in about:credits. |
| 227 NOT_SHIPPED = "NOT_SHIPPED" | 235 NOT_SHIPPED = "NOT_SHIPPED" |
| 228 | 236 |
| 229 | 237 |
| 230 class LicenseError(Exception): | 238 class LicenseError(Exception): |
| 231 """We raise this exception when a directory's licensing info isn't | 239 """We raise this exception when a directory's licensing info isn't |
| 232 fully filled out.""" | 240 fully filled out.""" |
| (...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 460 elif command == 'credits': | 468 elif command == 'credits': |
| 461 if not GenerateCredits(): | 469 if not GenerateCredits(): |
| 462 return 1 | 470 return 1 |
| 463 else: | 471 else: |
| 464 print __doc__ | 472 print __doc__ |
| 465 return 1 | 473 return 1 |
| 466 | 474 |
| 467 | 475 |
| 468 if __name__ == '__main__': | 476 if __name__ == '__main__': |
| 469 sys.exit(main()) | 477 sys.exit(main()) |
| OLD | NEW |