| OLD | NEW |
| 1 #!/usr/bin/python | 1 #!/usr/bin/python |
| 2 # Copyright (c) 2010 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2010 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 |
| 11 Commands: | 11 Commands: |
| 12 scan scan third_party directories, verifying that we have licensing info | 12 scan scan third_party directories, verifying that we have licensing info |
| 13 credits generate about:credits on stdout | 13 credits generate about:credits on stdout |
| 14 | 14 |
| 15 (You can also import this as a module.) | 15 (You can also import this as a module.) |
| 16 """ | 16 """ |
| 17 | 17 |
| 18 import cgi | 18 import cgi |
| 19 import os | 19 import os |
| 20 import sys | 20 import sys |
| 21 | 21 |
| 22 # Paths from the root of the tree to directories to skip. | 22 # Paths from the root of the tree to directories to skip. |
| 23 PRUNE_PATHS = set([ | 23 PRUNE_PATHS = set([ |
| 24 # Same module occurs in both the top-level third_party and others. |
| 25 "base/third_party/icu", |
| 26 |
| 24 # Assume for now that breakpad has their licensing in order. | 27 # Assume for now that breakpad has their licensing in order. |
| 25 "breakpad", | 28 "breakpad", |
| 26 | 29 |
| 27 # This is just a tiny vsprops file, presumably written by the googleurl | 30 # This is just a tiny vsprops file, presumably written by the googleurl |
| 28 # authors. Not third-party code. | 31 # authors. Not third-party code. |
| 29 "googleurl/third_party/icu", | 32 "googleurl/third_party/icu", |
| 30 | 33 |
| 31 # Assume for now that native client has their licensing in order. | 34 # Assume for now that native client has their licensing in order. |
| 32 "native_client", | 35 "native_client", |
| 33 | 36 |
| 37 # Same module occurs in chrome/ and in net/, so skip one of them. |
| 38 "net/third_party/mozilla_security_manager", |
| 39 |
| 40 # Same module occurs in base/ and in net/, so skip one of them. |
| 41 "net/third_party/nss", |
| 42 |
| 34 # We don't bundle o3d samples into our resulting binaries. | 43 # We don't bundle o3d samples into our resulting binaries. |
| 35 "o3d/samples", | 44 "o3d/samples", |
| 36 | 45 |
| 37 # Not in the public Chromium tree. | 46 # Not in the public Chromium tree. |
| 38 "third_party/adobe", | 47 "third_party/adobe", |
| 39 | 48 |
| 40 # Written as part of Chromium. | 49 # Written as part of Chromium. |
| 41 "third_party/fuzzymatch", | 50 "third_party/fuzzymatch", |
| 42 | 51 |
| 52 # Same license as Chromium. |
| 53 "third_party/lss", |
| 54 |
| 55 # Only binaries, used during development. |
| 56 "third_party/valgrind", |
| 57 |
| 43 # Two directories that are the same as those in base/third_party. | 58 # Two directories that are the same as those in base/third_party. |
| 44 "v8/src/third_party/dtoa", | 59 "v8/src/third_party/dtoa", |
| 45 "v8/src/third_party/valgrind", | 60 "v8/src/third_party/valgrind", |
| 46 | |
| 47 # Same module occurs in base/ and in net/, so skip one of them. | |
| 48 "net/third_party/nss", | |
| 49 | |
| 50 # Same module occurs in chrome/ and in net/, so skip one of them. | |
| 51 "net/third_party/mozilla_security_manager", | |
| 52 | |
| 53 # Same module occurs in both the top-level third_party and others. | |
| 54 "base/third_party/icu", | |
| 55 ]) | 61 ]) |
| 56 | 62 |
| 57 # Directories we don't scan through. | 63 # Directories we don't scan through. |
| 58 PRUNE_DIRS = ('.svn', '.git', # VCS metadata | 64 PRUNE_DIRS = ('.svn', '.git', # VCS metadata |
| 59 'out', 'Debug', 'Release', # build files | 65 'out', 'Debug', 'Release', # build files |
| 60 'layout_tests') # lots of subdirs | 66 'layout_tests') # lots of subdirs |
| 61 | 67 |
| 62 ADDITIONAL_PATHS = ( | 68 ADDITIONAL_PATHS = ( |
| 63 # The directory with the word list for Chinese and Japanese segmentation | 69 # The directory with the word list for Chinese and Japanese segmentation |
| 64 # with different license terms than ICU. | 70 # with different license terms than ICU. |
| (...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 256 | 262 |
| 257 if command == 'scan': | 263 if command == 'scan': |
| 258 if not ScanThirdPartyDirs(): | 264 if not ScanThirdPartyDirs(): |
| 259 sys.exit(1) | 265 sys.exit(1) |
| 260 elif command == 'credits': | 266 elif command == 'credits': |
| 261 if not GenerateCredits(): | 267 if not GenerateCredits(): |
| 262 sys.exit(1) | 268 sys.exit(1) |
| 263 else: | 269 else: |
| 264 print __doc__ | 270 print __doc__ |
| 265 sys.exit(1) | 271 sys.exit(1) |
| OLD | NEW |