Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(119)

Side by Side Diff: tools/licenses.py

Issue 10821103: Make 'License' field in third-party metadata required (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased Created 8 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « third_party/zlib/README.chromium ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 """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
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
103 ) 103 )
104 104
105 105
106 # Directories where we check out directly from upstream, and therefore 106 # Directories where we check out directly from upstream, and therefore
107 # can't provide a README.chromium. Please prefer a README.chromium 107 # can't provide a README.chromium. Please prefer a README.chromium
108 # wherever possible. 108 # wherever possible.
109 SPECIAL_CASES = { 109 SPECIAL_CASES = {
110 'googleurl': { 110 'googleurl': {
111 "Name": "google-url", 111 "Name": "google-url",
112 "URL": "http://code.google.com/p/google-url/", 112 "URL": "http://code.google.com/p/google-url/",
113 "License": "BSD and MPL 1.1/GPL 2.0/LGPL 2.1",
113 "License File": "LICENSE.txt", 114 "License File": "LICENSE.txt",
114 }, 115 },
115 os.path.join('third_party', 'angle'): { 116 os.path.join('third_party', 'angle'): {
116 "Name": "Almost Native Graphics Layer Engine", 117 "Name": "Almost Native Graphics Layer Engine",
117 "URL": "http://code.google.com/p/angleproject/", 118 "URL": "http://code.google.com/p/angleproject/",
119 "License": "BSD",
118 }, 120 },
119 os.path.join('third_party', 'cros_system_api'): { 121 os.path.join('third_party', 'cros_system_api'): {
120 "Name": "Chromium OS system API", 122 "Name": "Chromium OS system API",
121 "URL": "http://www.chromium.org/chromium-os", 123 "URL": "http://www.chromium.org/chromium-os",
122 "License": "BSD", 124 "License": "BSD",
123 # Absolute path here is resolved as relative to the source root. 125 # Absolute path here is resolved as relative to the source root.
124 "License File": "/LICENSE.chromium_os", 126 "License File": "/LICENSE.chromium_os",
125 }, 127 },
126 os.path.join('third_party', 'GTM'): { 128 os.path.join('third_party', 'GTM'): {
127 "Name": "Google Toolbox for Mac", 129 "Name": "Google Toolbox for Mac",
128 "URL": "http://code.google.com/p/google-toolbox-for-mac/", 130 "URL": "http://code.google.com/p/google-toolbox-for-mac/",
129 "License": "Apache 2.0", 131 "License": "Apache 2.0",
130 "License File": "COPYING", 132 "License File": "COPYING",
131 }, 133 },
132 os.path.join('third_party', 'lss'): { 134 os.path.join('third_party', 'lss'): {
133 "Name": "linux-syscall-support", 135 "Name": "linux-syscall-support",
134 "URL": "http://code.google.com/p/lss/", 136 "URL": "http://code.google.com/p/lss/",
135 }, 137 },
136 os.path.join('third_party', 'ots'): { 138 os.path.join('third_party', 'ots'): {
137 "Name": "OTS (OpenType Sanitizer)", 139 "Name": "OTS (OpenType Sanitizer)",
138 "URL": "http://code.google.com/p/ots/", 140 "URL": "http://code.google.com/p/ots/",
141 "License": "BSD",
139 }, 142 },
140 os.path.join('third_party', 'pdfsqueeze'): { 143 os.path.join('third_party', 'pdfsqueeze'): {
141 "Name": "pdfsqueeze", 144 "Name": "pdfsqueeze",
142 "URL": "http://code.google.com/p/pdfsqueeze/", 145 "URL": "http://code.google.com/p/pdfsqueeze/",
143 "License": "Apache 2.0", 146 "License": "Apache 2.0",
144 "License File": "COPYING", 147 "License File": "COPYING",
145 }, 148 },
146 os.path.join('third_party', 'ppapi'): { 149 os.path.join('third_party', 'ppapi'): {
147 "Name": "ppapi", 150 "Name": "ppapi",
148 "URL": "http://code.google.com/p/ppapi/", 151 "URL": "http://code.google.com/p/ppapi/",
149 }, 152 },
150 os.path.join('third_party', 'scons-2.0.1'): { 153 os.path.join('third_party', 'scons-2.0.1'): {
151 "Name": "scons-2.0.1", 154 "Name": "scons-2.0.1",
152 "URL": "http://www.scons.org", 155 "URL": "http://www.scons.org",
153 "License": "MIT", 156 "License": "MIT",
154 }, 157 },
155 os.path.join('third_party', 'trace-viewer'): { 158 os.path.join('third_party', 'trace-viewer'): {
156 "Name": "trace-viewer", 159 "Name": "trace-viewer",
157 "URL": "http://code.google.com/p/trace-viewer", 160 "URL": "http://code.google.com/p/trace-viewer",
158 "License": "BSD", 161 "License": "BSD",
159 }, 162 },
160 os.path.join('third_party', 'v8-i18n'): { 163 os.path.join('third_party', 'v8-i18n'): {
161 "Name": "Internationalization Library for v8", 164 "Name": "Internationalization Library for v8",
162 "URL": "http://code.google.com/p/v8-i18n/", 165 "URL": "http://code.google.com/p/v8-i18n/",
166 "License": "Apache 2.0, BSD and others",
163 }, 167 },
164 os.path.join('third_party', 'WebKit'): { 168 os.path.join('third_party', 'WebKit'): {
165 "Name": "WebKit", 169 "Name": "WebKit",
166 "URL": "http://webkit.org/", 170 "URL": "http://webkit.org/",
167 "License": "BSD and GPL v2", 171 "License": "BSD and GPL v2",
168 # Absolute path here is resolved as relative to the source root. 172 # Absolute path here is resolved as relative to the source root.
169 "License File": "/webkit/LICENSE", 173 "License File": "/webkit/LICENSE",
170 }, 174 },
171 os.path.join('third_party', 'webpagereplay'): { 175 os.path.join('third_party', 'webpagereplay'): {
172 "Name": "webpagereplay", 176 "Name": "webpagereplay",
173 "URL": "http://code.google.com/p/web-page-replay", 177 "URL": "http://code.google.com/p/web-page-replay",
174 "License": "Apache 2.0", 178 "License": "Apache 2.0",
175 }, 179 },
176 os.path.join('v8', 'strongtalk'): { 180 os.path.join('v8', 'strongtalk'): {
177 "Name": "Strongtalk", 181 "Name": "Strongtalk",
178 "URL": "http://www.strongtalk.org/", 182 "URL": "http://www.strongtalk.org/",
183 "License": "BSD",
179 # Absolute path here is resolved as relative to the source root. 184 # Absolute path here is resolved as relative to the source root.
180 "License File": "/v8/LICENSE.strongtalk", 185 "License File": "/v8/LICENSE.strongtalk",
181 }, 186 },
182 } 187 }
183 188
184 class LicenseError(Exception): 189 class LicenseError(Exception):
185 """We raise this exception when a directory's licensing info isn't 190 """We raise this exception when a directory's licensing info isn't
186 fully filled out.""" 191 fully filled out."""
187 pass 192 pass
188 193
(...skipping 12 matching lines...) Expand all
201 206
202 def ParseDir(path): 207 def ParseDir(path):
203 """Examine a third_party/foo component and extract its metadata.""" 208 """Examine a third_party/foo component and extract its metadata."""
204 209
205 # Parse metadata fields out of README.chromium. 210 # Parse metadata fields out of README.chromium.
206 # We examine "LICENSE" for the license file by default. 211 # We examine "LICENSE" for the license file by default.
207 metadata = { 212 metadata = {
208 "License File": "LICENSE", # Relative path to license text. 213 "License File": "LICENSE", # Relative path to license text.
209 "Name": None, # Short name (for header on about:credits). 214 "Name": None, # Short name (for header on about:credits).
210 "URL": None, # Project home page. 215 "URL": None, # Project home page.
216 "License": None, # Software license.
211 } 217 }
212 218
213 # Relative path to a file containing some html we're required to place in 219 # Relative path to a file containing some html we're required to place in
214 # about:credits. 220 # about:credits.
215 optional_keys = ["Required Text"] 221 optional_keys = ["Required Text"]
216 222
217 if path in SPECIAL_CASES: 223 if path in SPECIAL_CASES:
218 metadata.update(SPECIAL_CASES[path]) 224 metadata.update(SPECIAL_CASES[path])
219 else: 225 else:
220 # Try to find README.chromium. 226 # Try to find README.chromium.
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after
384 elif command == 'credits': 390 elif command == 'credits':
385 if not GenerateCredits(): 391 if not GenerateCredits():
386 return 1 392 return 1
387 else: 393 else:
388 print __doc__ 394 print __doc__
389 return 1 395 return 1
390 396
391 397
392 if __name__ == '__main__': 398 if __name__ == '__main__':
393 sys.exit(main()) 399 sys.exit(main())
OLDNEW
« no previous file with comments | « third_party/zlib/README.chromium ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698