From 51ec016f76af3617429c8da3e0c424d480d5ba46 Mon Sep 17 00:00:00 2001 From: Matthew Maurer Date: Wed, 10 Aug 2022 15:29:24 -0700 Subject: [PATCH] rust: addr3prf: Support COPYING files Previously, we only looked for LICENSE* files. This adds support for detecting COPYING* files as an alternate representation of the license. Bug: 234563254 Test: get_rust_pkg.py -add3prf quiche Change-Id: Ic04ef42f349879be18a4307bd863288dfa81b5fc --- scripts/add3prf.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/add3prf.py b/scripts/add3prf.py index 1ac1e69ce..419b8eb63 100755 --- a/scripts/add3prf.py +++ b/scripts/add3prf.py @@ -164,7 +164,7 @@ def decide_license_type(cargo_license): # Some crate like time-macros-impl uses lower case names like LICENSE-Apache. licenses = [] 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() if lowered_name == "license-apache": licenses.append(License(LicenseType.APACHE2, license_file)) @@ -175,7 +175,7 @@ def decide_license_type(cargo_license): return licenses if not license_file: 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. if "Apache" in cargo_license: return [License(LicenseType.APACHE2, license_file)]