OLD | NEW |
1 #!/usr/bin/python | 1 #!/usr/bin/python |
2 # Copyright (c) 2011 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2011 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 15 matching lines...) Expand all Loading... |
26 python checklicenses.py --root ~/chromium/src third_party""" | 26 python checklicenses.py --root ~/chromium/src third_party""" |
27 | 27 |
28 | 28 |
29 WHITELISTED_LICENSES = [ | 29 WHITELISTED_LICENSES = [ |
30 'Apache (v2.0)', | 30 'Apache (v2.0)', |
31 'Apache (v2.0) BSD (2 clause)', | 31 'Apache (v2.0) BSD (2 clause)', |
32 'BSD', | 32 'BSD', |
33 'BSD (2 clause)', | 33 'BSD (2 clause)', |
34 'BSD (2 clause) MIT/X11 (BSD like)', | 34 'BSD (2 clause) MIT/X11 (BSD like)', |
35 'BSD (3 clause)', | 35 'BSD (3 clause)', |
| 36 'BSD (3 clause) ISC', |
| 37 'BSD (3 clause) LGPL (v2.1 or later) (with incorrect FSF address)', |
36 'BSD (3 clause) MIT/X11 (BSD like)', | 38 'BSD (3 clause) MIT/X11 (BSD like)', |
37 'BSD (4 clause)', | 39 'BSD (4 clause)', |
38 'BSD-like', | 40 'BSD-like', |
39 | 41 |
40 # TODO(phajdan.jr): Make licensecheck not print BSD-like twice. | 42 # TODO(phajdan.jr): Make licensecheck not print BSD-like twice. |
41 'BSD-like BSD (2 clause)', | 43 'BSD-like BSD (2 clause)', |
42 'BSD-like BSD (3 clause)', | 44 'BSD-like BSD (3 clause)', |
43 'BSD-like MIT/X11 (BSD like)', | 45 'BSD-like MIT/X11 (BSD like)', |
44 | 46 |
45 'BSL (v1.0)', | 47 'BSL (v1.0)', |
46 # TODO(phajdan.jr): Make licensecheck not print the comma after 3.1. | 48 # TODO(phajdan.jr): Make licensecheck not print the comma after 3.1. |
47 'BSL (v1.0) GPL (v3.1,)', | 49 'BSL (v1.0) GPL (v3.1,)', |
48 'ISC', | 50 'ISC', |
49 'LGPL', | 51 'LGPL', |
50 'LGPL (v2)', | 52 'LGPL (v2)', |
51 'LGPL (v2 or later)', | 53 'LGPL (v2 or later)', |
52 'LGPL (v2 or later) (with incorrect FSF address)', | 54 'LGPL (v2 or later) (with incorrect FSF address)', |
53 'LGPL (v2.1)', | 55 'LGPL (v2.1)', |
54 'LGPL (v3 or later)', | 56 'LGPL (v3 or later)', |
55 | 57 |
56 # TODO(phajdan.jr): Make licensecheck convert that comma to a dot. | 58 # TODO(phajdan.jr): Make licensecheck convert that comma to a dot. |
57 'LGPL (v2,1 or later)', | 59 'LGPL (v2,1 or later)', |
58 | 60 |
59 'LGPL (v2.1 or later)', | 61 'LGPL (v2.1 or later)', |
60 'LGPL (v2.1 or later) (with incorrect FSF address)', | 62 'LGPL (v2.1 or later) (with incorrect FSF address)', |
61 'MPL (v1.0) LGPL (v2 or later) (with incorrect FSF address)', | 63 'MPL (v1.0) LGPL (v2 or later) (with incorrect FSF address)', |
| 64 'MPL (v1.1)', |
62 'MPL (v1.1) BSD-like', | 65 'MPL (v1.1) BSD-like', |
63 'MPL (v1.1) BSD-like GPL (unversioned/unknown version)', | 66 'MPL (v1.1) BSD-like GPL (unversioned/unknown version)', |
64 'MPL (v1.1) GPL (unversioned/unknown version)', | 67 'MPL (v1.1) GPL (unversioned/unknown version)', |
65 | 68 |
66 # TODO(phajdan.jr): Make licensecheck not print the comma after 1.1. | 69 # TODO(phajdan.jr): Make licensecheck not print the comma after 1.1. |
67 'MPL (v1.1,) GPL (unversioned/unknown version) LGPL (v2 or later)', | 70 'MPL (v1.1,) GPL (unversioned/unknown version) LGPL (v2 or later)', |
68 'MPL (v1.1,) GPL (unversioned/unknown version) LGPL (v2.1 or later)', | 71 'MPL (v1.1,) GPL (unversioned/unknown version) LGPL (v2.1 or later)', |
69 | 72 |
70 'MIT/X11 (BSD like)', | 73 'MIT/X11 (BSD like)', |
71 'Ms-PL', | 74 'Ms-PL', |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
115 ], | 118 ], |
116 'gpu/KHR': [ | 119 'gpu/KHR': [ |
117 'UNKNOWN', | 120 'UNKNOWN', |
118 ], | 121 ], |
119 'gpu/gles2_conform_support/egl/native/EGL': [ | 122 'gpu/gles2_conform_support/egl/native/EGL': [ |
120 'UNKNOWN', | 123 'UNKNOWN', |
121 ], | 124 ], |
122 'native_client': [ | 125 'native_client': [ |
123 'UNKNOWN', | 126 'UNKNOWN', |
124 ], | 127 ], |
125 'native_client/toolchain/linux_x86_newlib': [ | 128 'native_client/toolchain': [ |
| 129 'BSD GPL (v2 or later) (with incorrect FSF address)', |
| 130 'BSD (2 clause) GPL (v2 or later)', |
| 131 'BSL (v1.0) GPL', |
126 'GPL', | 132 'GPL', |
| 133 'GPL (with incorrect FSF address)', |
| 134 'GPL (unversioned/unknown version)', |
| 135 'GPL (v2)', |
| 136 |
| 137 # TODO(phajdan.jr): Make licensecheck not print the comma after v2. |
| 138 'GPL (v2,)', |
| 139 |
| 140 'GPL (v2 or later)', |
| 141 'GPL (v2 or later) (with incorrect FSF address)', |
| 142 |
| 143 # TODO(phajdan.jr): Make licensecheck not print the comma after 3.1. |
127 'GPL (v3.1,)', | 144 'GPL (v3.1,)', |
128 ], | 145 ], |
129 'net/disk_cache/hash.cc': [ | 146 'net/disk_cache/hash.cc': [ |
130 'UNKNOWN', | 147 'UNKNOWN', |
131 ], | 148 ], |
132 'net/third_party/nss/patches/applypatches.sh': [ | 149 'net/third_party/nss/patches/applypatches.sh': [ |
133 'UNKNOWN', | 150 'UNKNOWN', |
134 ], | 151 ], |
135 'net/tools/spdyshark': [ | 152 'net/tools/spdyshark': [ |
136 'GPL (v2 or later) (with incorrect FSF address)', | 153 'GPL (v2 or later) (with incorrect FSF address)', |
(...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
367 ], | 384 ], |
368 'third_party/yasm/source': [ | 385 'third_party/yasm/source': [ |
369 'UNKNOWN', | 386 'UNKNOWN', |
370 ], | 387 ], |
371 'third_party/zlib/contrib/minizip': [ | 388 'third_party/zlib/contrib/minizip': [ |
372 'UNKNOWN', | 389 'UNKNOWN', |
373 ], | 390 ], |
374 'third_party/zlib/trees.h': [ | 391 'third_party/zlib/trees.h': [ |
375 'UNKNOWN', | 392 'UNKNOWN', |
376 ], | 393 ], |
377 'third_party/WebKit/LayoutTests/fast/xsl': [ | |
378 'MPL (v1.1)', | |
379 ], | |
380 'tools/dromaeo_benchmark_runner/dromaeo_benchmark_runner.py': [ | 394 'tools/dromaeo_benchmark_runner/dromaeo_benchmark_runner.py': [ |
381 'UNKNOWN', | 395 'UNKNOWN', |
382 ], | 396 ], |
383 'tools/emacs': [ | 397 'tools/emacs': [ |
384 'UNKNOWN', | 398 'UNKNOWN', |
385 ], | 399 ], |
386 'tools/grit/grit/node/custom/__init__.py': [ | 400 'tools/grit/grit/node/custom/__init__.py': [ |
387 'UNKNOWN', | 401 'UNKNOWN', |
388 ], | 402 ], |
389 'tools/gyp/test': [ | 403 'tools/gyp/test': [ |
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
497 sys.exit(0) | 511 sys.exit(0) |
498 else: | 512 else: |
499 print "\nFAILED\n" | 513 print "\nFAILED\n" |
500 print "Please read", | 514 print "Please read", |
501 print "http://www.chromium.org/developers/adding-3rd-party-libraries" | 515 print "http://www.chromium.org/developers/adding-3rd-party-libraries" |
502 print "for more info how to handle the failure." | 516 print "for more info how to handle the failure." |
503 print | 517 print |
504 print "Please respect OWNERS of checklicenses.py. Changes violating" | 518 print "Please respect OWNERS of checklicenses.py. Changes violating" |
505 print "this requirement may be reverted." | 519 print "this requirement may be reverted." |
506 | 520 |
507 # TODO(phajdan.jr): Switch back to exit(1) when it lands on buildbot. | 521 sys.exit(1) |
508 # 88 is buildbot "warning" code, it doesn't turn the step red but orange. | |
509 sys.exit(88) | |
510 | 522 |
511 | 523 |
512 if '__main__' == __name__: | 524 if '__main__' == __name__: |
513 default_root = os.path.abspath( | 525 default_root = os.path.abspath( |
514 os.path.join(os.path.dirname(__file__), '..', '..')) | 526 os.path.join(os.path.dirname(__file__), '..', '..')) |
515 option_parser = optparse.OptionParser() | 527 option_parser = optparse.OptionParser() |
516 option_parser.add_option('--root', default=default_root, | 528 option_parser.add_option('--root', default=default_root, |
517 dest='base_directory', | 529 dest='base_directory', |
518 help='Specifies the repository root. This defaults ' | 530 help='Specifies the repository root. This defaults ' |
519 'to "../.." relative to the script file, which ' | 531 'to "../.." relative to the script file, which ' |
520 'will normally be the repository root.') | 532 'will normally be the repository root.') |
521 option_parser.add_option('-v', '--verbose', action='store_true', | 533 option_parser.add_option('-v', '--verbose', action='store_true', |
522 default=False, help='Print debug logging') | 534 default=False, help='Print debug logging') |
523 options, args = option_parser.parse_args() | 535 options, args = option_parser.parse_args() |
524 main(options, args) | 536 main(options, args) |
OLD | NEW |