| 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 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 102 }, | 102 }, |
| 103 os.path.join('sandbox', 'linux', 'seccomp-legacy'): { | 103 os.path.join('sandbox', 'linux', 'seccomp-legacy'): { |
| 104 "Name": "seccompsandbox", | 104 "Name": "seccompsandbox", |
| 105 "URL": "http://code.google.com/p/seccompsandbox", | 105 "URL": "http://code.google.com/p/seccompsandbox", |
| 106 "License": "BSD", | 106 "License": "BSD", |
| 107 }, | 107 }, |
| 108 os.path.join('sdch', 'open-vcdiff'): { | 108 os.path.join('sdch', 'open-vcdiff'): { |
| 109 "Name": "open-vcdiff", | 109 "Name": "open-vcdiff", |
| 110 "URL": "http://code.google.com/p/open-vcdiff", | 110 "URL": "http://code.google.com/p/open-vcdiff", |
| 111 "License": "Apache 2.0, MIT, GPL v2 and custom licenses", | 111 "License": "Apache 2.0, MIT, GPL v2 and custom licenses", |
| 112 "Android Compatibility": "yes", |
| 112 }, | 113 }, |
| 113 os.path.join('testing', 'gmock'): { | 114 os.path.join('testing', 'gmock'): { |
| 114 "Name": "gmock", | 115 "Name": "gmock", |
| 115 "URL": "http://code.google.com/p/googlemock", | 116 "URL": "http://code.google.com/p/googlemock", |
| 116 "License": "BSD", | 117 "License": "BSD", |
| 117 }, | 118 }, |
| 118 os.path.join('testing', 'gtest'): { | 119 os.path.join('testing', 'gtest'): { |
| 119 "Name": "gtest", | 120 "Name": "gtest", |
| 120 "URL": "http://code.google.com/p/googletest", | 121 "URL": "http://code.google.com/p/googletest", |
| 121 "License": "BSD", | 122 "License": "BSD", |
| (...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 240 # We examine "LICENSE" for the license file by default. | 241 # We examine "LICENSE" for the license file by default. |
| 241 metadata = { | 242 metadata = { |
| 242 "License File": "LICENSE", # Relative path to license text. | 243 "License File": "LICENSE", # Relative path to license text. |
| 243 "Name": None, # Short name (for header on about:credits). | 244 "Name": None, # Short name (for header on about:credits). |
| 244 "URL": None, # Project home page. | 245 "URL": None, # Project home page. |
| 245 "License": None, # Software license. | 246 "License": None, # Software license. |
| 246 } | 247 } |
| 247 | 248 |
| 248 # Relative path to a file containing some html we're required to place in | 249 # Relative path to a file containing some html we're required to place in |
| 249 # about:credits. | 250 # about:credits. |
| 250 optional_keys = ["Required Text"] | 251 optional_keys = ["Required Text", "Android Compatibility"] |
| 251 | 252 |
| 252 if path in SPECIAL_CASES: | 253 if path in SPECIAL_CASES: |
| 253 metadata.update(SPECIAL_CASES[path]) | 254 metadata.update(SPECIAL_CASES[path]) |
| 254 else: | 255 else: |
| 255 # Try to find README.chromium. | 256 # Try to find README.chromium. |
| 256 readme_path = os.path.join(path, 'README.chromium') | 257 readme_path = os.path.join(path, 'README.chromium') |
| 257 if not os.path.exists(readme_path): | 258 if not os.path.exists(readme_path): |
| 258 raise LicenseError("missing README.chromium or licenses.py " | 259 raise LicenseError("missing README.chromium or licenses.py " |
| 259 "SPECIAL_CASES entry") | 260 "SPECIAL_CASES entry") |
| 260 | 261 |
| (...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 426 elif command == 'credits': | 427 elif command == 'credits': |
| 427 if not GenerateCredits(): | 428 if not GenerateCredits(): |
| 428 return 1 | 429 return 1 |
| 429 else: | 430 else: |
| 430 print __doc__ | 431 print __doc__ |
| 431 return 1 | 432 return 1 |
| 432 | 433 |
| 433 | 434 |
| 434 if __name__ == '__main__': | 435 if __name__ == '__main__': |
| 435 sys.exit(main()) | 436 sys.exit(main()) |
| OLD | NEW |