| OLD | NEW |
| 1 #!/usr/bin/python | 1 #!/usr/bin/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 """Checks third-party licenses for the purposes of the Android WebView build. | 6 """Checks third-party licenses for the purposes of the Android WebView build. |
| 7 | 7 |
| 8 The Android tree includes a snapshot of Chromium in order to power the system | 8 The Android tree includes a snapshot of Chromium in order to power the system |
| 9 WebView. This tool checks that all code uses open-source licenses compatible | 9 WebView. This tool checks that all code uses open-source licenses compatible |
| 10 with Android, and that we meet the requirements of those licenses. It can also | 10 with Android, and that we meet the requirements of those licenses. It can also |
| (...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 233 The contents of the NOTICE file. | 233 The contents of the NOTICE file. |
| 234 """ | 234 """ |
| 235 | 235 |
| 236 third_party_dirs = _FindThirdPartyDirs() | 236 third_party_dirs = _FindThirdPartyDirs() |
| 237 | 237 |
| 238 # Don't forget Chromium's LICENSE file | 238 # Don't forget Chromium's LICENSE file |
| 239 content = [_ReadFile('LICENSE')] | 239 content = [_ReadFile('LICENSE')] |
| 240 | 240 |
| 241 # We provide attribution for all third-party directories. | 241 # We provide attribution for all third-party directories. |
| 242 # TODO(steveblock): Limit this to only code used by the WebView binary. | 242 # TODO(steveblock): Limit this to only code used by the WebView binary. |
| 243 for directory in third_party_dirs: | 243 for directory in sorted(third_party_dirs): |
| 244 metadata = licenses.ParseDir(directory, REPOSITORY_ROOT, | 244 metadata = licenses.ParseDir(directory, REPOSITORY_ROOT, |
| 245 require_license_file=False) | 245 require_license_file=False) |
| 246 license_file = metadata['License File'] | 246 license_file = metadata['License File'] |
| 247 if license_file and license_file != licenses.NOT_SHIPPED: | 247 if license_file and license_file != licenses.NOT_SHIPPED: |
| 248 content.append(_ReadFile(license_file)) | 248 content.append(_ReadFile(license_file)) |
| 249 | 249 |
| 250 return '\n'.join(content) | 250 return '\n'.join(content) |
| 251 | 251 |
| 252 | 252 |
| 253 def main(): | 253 def main(): |
| (...skipping 21 matching lines...) Expand all Loading... |
| 275 return scan_result | 275 return scan_result |
| 276 elif args[0] == 'notice': | 276 elif args[0] == 'notice': |
| 277 print GenerateNoticeFile() | 277 print GenerateNoticeFile() |
| 278 return ScanResult.Ok | 278 return ScanResult.Ok |
| 279 | 279 |
| 280 parser.print_help() | 280 parser.print_help() |
| 281 return ScanResult.Errors | 281 return ScanResult.Errors |
| 282 | 282 |
| 283 if __name__ == '__main__': | 283 if __name__ == '__main__': |
| 284 sys.exit(main()) | 284 sys.exit(main()) |
| OLD | NEW |