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

Unified Diff: tools/licenses.py

Issue 10829355: Make checking the existence of the license file optional in the license tool (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Remove unused print_warnings 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « android_webview/tools/webview_licenses.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/licenses.py
diff --git a/tools/licenses.py b/tools/licenses.py
index 8feda9cb4500bb5328918262f75ae6b955a60709..d5bd3168024f6b5a93909d472ebea98a21ae1f27 100755
--- a/tools/licenses.py
+++ b/tools/licenses.py
@@ -234,7 +234,7 @@ def AbsolutePath(path, filename):
return absolute_path
return None
-def ParseDir(path):
+def ParseDir(path, require_license_file=True):
"""Examine a third_party/foo component and extract its metadata."""
# Parse metadata fields out of README.chromium.
@@ -282,15 +282,15 @@ def ParseDir(path):
for filename in (metadata["License File"], "COPYING"):
license_path = AbsolutePath(path, filename)
if license_path is not None:
- metadata["License File"] = license_path
break
- if not license_path:
+ if require_license_file and not license_path:
raise LicenseError("License file not found. "
"Either add a file named LICENSE, "
"import upstream's COPYING if available, "
"or add a 'License File:' line to "
"README.chromium with the appropriate path.")
+ metadata["License File"] = license_path
if "Required Text" in metadata:
required_path = AbsolutePath(path, metadata["Required Text"])
« no previous file with comments | « android_webview/tools/webview_licenses.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698