Chromium Code Reviews| 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 """Makes sure that all files contain proper licensing information.""" | 6 """Makes sure that all files contain proper licensing information.""" |
| 7 | 7 |
| 8 | 8 |
| 9 import optparse | 9 import optparse |
| 10 import os.path | 10 import os.path |
| (...skipping 475 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 486 print "\nFAILED\n" | 486 print "\nFAILED\n" |
| 487 return 1 | 487 return 1 |
| 488 | 488 |
| 489 success = True | 489 success = True |
| 490 for line in stdout.splitlines(): | 490 for line in stdout.splitlines(): |
| 491 filename, license = line.split(':', 1) | 491 filename, license = line.split(':', 1) |
| 492 filename = os.path.relpath(filename.strip(), options.base_directory) | 492 filename = os.path.relpath(filename.strip(), options.base_directory) |
| 493 | 493 |
| 494 # All files in the build output directory are generated one way or another. | 494 # All files in the build output directory are generated one way or another. |
| 495 # There's no need to check them. | 495 # There's no need to check them. |
| 496 if filename.startswith('out/') or filename.startswith('sconsbuild/'): | 496 if filename.startswith('out/'): |
|
Lei Zhang
2013/10/09 18:59:14
Do bots still have a sconsbuild symlink? Can we ac
Nico
2013/10/09 19:22:25
If so, we can remove those symlinks, right?
| |
| 497 continue | 497 continue |
| 498 | 498 |
| 499 # For now we're just interested in the license. | 499 # For now we're just interested in the license. |
| 500 license = license.replace('*No copyright*', '').strip() | 500 license = license.replace('*No copyright*', '').strip() |
| 501 | 501 |
| 502 # Skip generated files. | 502 # Skip generated files. |
| 503 if 'GENERATED FILE' in license: | 503 if 'GENERATED FILE' in license: |
| 504 continue | 504 continue |
| 505 | 505 |
| 506 if license in WHITELISTED_LICENSES: | 506 if license in WHITELISTED_LICENSES: |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 547 option_parser.add_option('--ignore-suppressions', | 547 option_parser.add_option('--ignore-suppressions', |
| 548 action='store_true', | 548 action='store_true', |
| 549 default=False, | 549 default=False, |
| 550 help='Ignore path-specific license whitelist.') | 550 help='Ignore path-specific license whitelist.') |
| 551 options, args = option_parser.parse_args() | 551 options, args = option_parser.parse_args() |
| 552 return check_licenses(options, args) | 552 return check_licenses(options, args) |
| 553 | 553 |
| 554 | 554 |
| 555 if '__main__' == __name__: | 555 if '__main__' == __name__: |
| 556 sys.exit(main()) | 556 sys.exit(main()) |
| OLD | NEW |