Merge "rust: addr3prf: Support COPYING files" am: a2fff95476 am: 5584fd7393 am: 9d224221ac am: 7f1c02853c
Original change: https://android-review.googlesource.com/c/platform/development/+/2182815 Change-Id: I051950faa153a278c2873c0ec21dff21759445b3 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
@@ -164,7 +164,7 @@ def decide_license_type(cargo_license):
|
|||||||
# Some crate like time-macros-impl uses lower case names like LICENSE-Apache.
|
# Some crate like time-macros-impl uses lower case names like LICENSE-Apache.
|
||||||
licenses = []
|
licenses = []
|
||||||
license_file = None
|
license_file = None
|
||||||
for license_file in glob.glob("LICENSE*"):
|
for license_file in glob.glob("LICENSE*") + glob.glob("COPYING*"):
|
||||||
lowered_name = license_file.lower()
|
lowered_name = license_file.lower()
|
||||||
if lowered_name == "license-apache":
|
if lowered_name == "license-apache":
|
||||||
licenses.append(License(LicenseType.APACHE2, license_file))
|
licenses.append(License(LicenseType.APACHE2, license_file))
|
||||||
@@ -175,7 +175,7 @@ def decide_license_type(cargo_license):
|
|||||||
return licenses
|
return licenses
|
||||||
if not license_file:
|
if not license_file:
|
||||||
raise FileNotFoundError("No license file has been found.")
|
raise FileNotFoundError("No license file has been found.")
|
||||||
# There is a LICENSE or LICENSE.txt file, use cargo_license found in
|
# There is a LICENSE* or COPYING* file, use cargo_license found in
|
||||||
# Cargo.toml.
|
# Cargo.toml.
|
||||||
if "Apache" in cargo_license:
|
if "Apache" in cargo_license:
|
||||||
return [License(LicenseType.APACHE2, license_file)]
|
return [License(LicenseType.APACHE2, license_file)]
|
||||||
|
|||||||
Reference in New Issue
Block a user