| OLD | NEW |
| 1 # Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 # Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| 2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
| 3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
| 4 | 4 |
| 5 ANDROID_WHITELISTED_LICENSES = [ | 5 ANDROID_WHITELISTED_LICENSES = [ |
| 6 'A(pple )?PSL 2(\.0)?', | 6 'A(pple )?PSL 2(\.0)?', |
| 7 'Apache( Version)? 2(\.0)?', | 7 'Apache( Version)? 2(\.0)?', |
| 8 '(New )?([23]-Clause )?BSD( [23]-Clause)?( with advertising clause)?', | 8 '(New )?([23]-Clause )?BSD( [23]-Clause)?( with advertising clause)?', |
| 9 'L?GPL ?v?2(\.[01])?( or later)?', | 9 'L?GPL ?v?2(\.[01])?( or later)?', |
| 10 'MIT(/X11)?(-like)?', | 10 'MIT(/X11)?(-like)?', |
| (...skipping 28 matching lines...) Expand all Loading... |
| 39 files = [] | 39 files = [] |
| 40 errors = [] | 40 errors = [] |
| 41 for f in input_api.AffectedFiles(): | 41 for f in input_api.AffectedFiles(): |
| 42 local_path = f.LocalPath() | 42 local_path = f.LocalPath() |
| 43 if input_api.os_path.dirname(local_path) == 'third_party': | 43 if input_api.os_path.dirname(local_path) == 'third_party': |
| 44 continue | 44 continue |
| 45 if (local_path.startswith('third_party' + input_api.os_path.sep) and | 45 if (local_path.startswith('third_party' + input_api.os_path.sep) and |
| 46 not local_path.startswith('third_party' + input_api.os_path.sep + | 46 not local_path.startswith('third_party' + input_api.os_path.sep + |
| 47 'WebKit' + input_api.os_path.sep) and | 47 'WebKit' + input_api.os_path.sep) and |
| 48 not local_path.startswith('third_party' + input_api.os_path.sep + | 48 not local_path.startswith('third_party' + input_api.os_path.sep + |
| 49 'mojo' + input_api.os_path.sep) and |
| 50 not local_path.startswith('third_party' + input_api.os_path.sep + |
| 49 'boringssl' + input_api.os_path.sep)): | 51 'boringssl' + input_api.os_path.sep)): |
| 50 files.append(f) | 52 files.append(f) |
| 51 if local_path.endswith("README.chromium"): | 53 if local_path.endswith("README.chromium"): |
| 52 readmes.append(f) | 54 readmes.append(f) |
| 53 if files and not readmes: | 55 if files and not readmes: |
| 54 errors.append(output_api.PresubmitPromptWarning( | 56 errors.append(output_api.PresubmitPromptWarning( |
| 55 'When updating or adding third party code the appropriate\n' | 57 'When updating or adding third party code the appropriate\n' |
| 56 '\'README.chromium\' file should also be updated with the correct\n' | 58 '\'README.chromium\' file should also be updated with the correct\n' |
| 57 'version and package information.', files)) | 59 'version and package information.', files)) |
| 58 if not readmes: | 60 if not readmes: |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 128 if 'D' not in f.Action(): | 130 if 'D' not in f.Action(): |
| 129 errors.append(output_api.PresubmitError( | 131 errors.append(output_api.PresubmitError( |
| 130 'Third party README should only be removed when the whole\n' | 132 'Third party README should only be removed when the whole\n' |
| 131 'directory is being removed.\n', [f, affected_file])) | 133 'directory is being removed.\n', [f, affected_file])) |
| 132 | 134 |
| 133 | 135 |
| 134 def CheckChangeOnUpload(input_api, output_api): | 136 def CheckChangeOnUpload(input_api, output_api): |
| 135 results = [] | 137 results = [] |
| 136 results.extend(_CheckThirdPartyReadmesUpdated(input_api, output_api)) | 138 results.extend(_CheckThirdPartyReadmesUpdated(input_api, output_api)) |
| 137 return results | 139 return results |
| OLD | NEW |