Chih-Hung Hsieh | 3d24aed | 2020-10-05 15:29:11 -0700 | [diff] [blame] | 1 | #!/usr/bin/env python3 |
| 2 | # |
| 3 | # Copyright (C) 2020 The Android Open Source Project |
| 4 | # |
| 5 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 6 | # you may not use this file except in compliance with the License. |
| 7 | # You may obtain a copy of the License at |
| 8 | # |
| 9 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 10 | # |
| 11 | # Unless required by applicable law or agreed to in writing, software |
| 12 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 14 | # See the License for the specific language governing permissions and |
| 15 | # limitations under the License. |
| 16 | """Add files to a Rust package for third party review.""" |
| 17 | |
Thiébaud Weksteen | 8da4911 | 2021-02-19 11:59:49 +0100 | [diff] [blame] | 18 | import collections |
Chih-Hung Hsieh | 3d24aed | 2020-10-05 15:29:11 -0700 | [diff] [blame] | 19 | import datetime |
Thiébaud Weksteen | 8da4911 | 2021-02-19 11:59:49 +0100 | [diff] [blame] | 20 | import enum |
Chih-Hung Hsieh | 03f14e4 | 2020-10-19 18:38:30 -0700 | [diff] [blame] | 21 | import glob |
Chih-Hung Hsieh | 3d24aed | 2020-10-05 15:29:11 -0700 | [diff] [blame] | 22 | import json |
| 23 | import os |
| 24 | import pathlib |
| 25 | import re |
| 26 | |
| 27 | # patterns to match keys in Cargo.toml |
| 28 | NAME_PATTERN = r"^name *= *\"(.+)\"" |
| 29 | NAME_MATCHER = re.compile(NAME_PATTERN) |
| 30 | VERSION_PATTERN = r"^version *= *\"(.+)\"" |
| 31 | VERSION_MATCHER = re.compile(VERSION_PATTERN) |
| 32 | DESCRIPTION_PATTERN = r"^description *= *(\".+\")" |
| 33 | DESCRIPTION_MATCHER = re.compile(DESCRIPTION_PATTERN) |
| 34 | # NOTE: This description one-liner pattern fails to match |
| 35 | # multi-line descriptions in some Rust crates, e.g. shlex. |
Chih-Hung Hsieh | 03f14e4 | 2020-10-19 18:38:30 -0700 | [diff] [blame] | 36 | LICENSE_PATTERN = r"^license *= *\"(.+)\"" |
| 37 | LICENSE_MATCHER = re.compile(LICENSE_PATTERN) |
Chih-Hung Hsieh | 3d24aed | 2020-10-05 15:29:11 -0700 | [diff] [blame] | 38 | |
| 39 | # patterns to match year/month/day in METADATA |
| 40 | YMD_PATTERN = r"^ +(year|month|day): (.+)$" |
| 41 | YMD_MATCHER = re.compile(YMD_PATTERN) |
| 42 | YMD_LINE_PATTERN = r"^.* year: *([^ ]+) +month: *([^ ]+) +day: *([^ ]+).*$" |
| 43 | YMD_LINE_MATCHER = re.compile(YMD_LINE_PATTERN) |
| 44 | |
| 45 | # patterns to match Apache/MIT licence in LICENSE* |
| 46 | APACHE_PATTERN = r"^.*Apache License.*$" |
| 47 | APACHE_MATCHER = re.compile(APACHE_PATTERN) |
| 48 | MIT_PATTERN = r"^.*MIT License.*$" |
| 49 | MIT_MATCHER = re.compile(MIT_PATTERN) |
| 50 | BSD_PATTERN = r"^.*BSD .*License.*$" |
| 51 | BSD_MATCHER = re.compile(BSD_PATTERN) |
Thiébaud Weksteen | 8da4911 | 2021-02-19 11:59:49 +0100 | [diff] [blame] | 52 | MULTI_LICENSE_COMMENT = ("# Dual-licensed, using the least restrictive " |
| 53 | "per go/thirdpartylicenses#same.\n ") |
Chih-Hung Hsieh | 3d24aed | 2020-10-05 15:29:11 -0700 | [diff] [blame] | 54 | |
| 55 | # default owners added to OWNERS |
Ivan Lozano | 70c12c5 | 2021-07-30 14:37:09 -0400 | [diff] [blame] | 56 | DEFAULT_OWNERS = "include platform/prebuilts/rust:master:/OWNERS\n" |
Chih-Hung Hsieh | 3d24aed | 2020-10-05 15:29:11 -0700 | [diff] [blame] | 57 | |
| 58 | # See b/159487435 Official policy for rust imports METADATA URLs. |
| 59 | # "license_type: NOTICE" might be optional, |
| 60 | # but it is already used in most rust crate METADATA. |
| 61 | # This line format should match the output of external_updater. |
Thiébaud Weksteen | 8da4911 | 2021-02-19 11:59:49 +0100 | [diff] [blame] | 62 | METADATA_CONTENT = """name: "{name}" |
| 63 | description: {description} |
Chih-Hung Hsieh | 3d24aed | 2020-10-05 15:29:11 -0700 | [diff] [blame] | 64 | third_party {{ |
| 65 | url {{ |
| 66 | type: HOMEPAGE |
Thiébaud Weksteen | 8da4911 | 2021-02-19 11:59:49 +0100 | [diff] [blame] | 67 | value: "https://crates.io/crates/{name}" |
Chih-Hung Hsieh | 3d24aed | 2020-10-05 15:29:11 -0700 | [diff] [blame] | 68 | }} |
| 69 | url {{ |
| 70 | type: ARCHIVE |
Thiébaud Weksteen | 8da4911 | 2021-02-19 11:59:49 +0100 | [diff] [blame] | 71 | value: "https://static.crates.io/crates/{name}/{name}-{version}.crate" |
Chih-Hung Hsieh | 3d24aed | 2020-10-05 15:29:11 -0700 | [diff] [blame] | 72 | }} |
Thiébaud Weksteen | 8da4911 | 2021-02-19 11:59:49 +0100 | [diff] [blame] | 73 | version: "{version}" |
| 74 | {license_comment}license_type: NOTICE |
Chih-Hung Hsieh | 3d24aed | 2020-10-05 15:29:11 -0700 | [diff] [blame] | 75 | last_upgrade_date {{ |
Thiébaud Weksteen | 8da4911 | 2021-02-19 11:59:49 +0100 | [diff] [blame] | 76 | year: {year} |
| 77 | month: {month} |
| 78 | day: {day} |
Chih-Hung Hsieh | 3d24aed | 2020-10-05 15:29:11 -0700 | [diff] [blame] | 79 | }} |
| 80 | }} |
| 81 | """ |
| 82 | |
| 83 | |
| 84 | def get_metadata_date(): |
| 85 | """Return last_upgrade_date in METADATA or today.""" |
| 86 | # When applied to existing directories to normalize METADATA, |
| 87 | # we don't want to change the last_upgrade_date. |
| 88 | year, month, day = "", "", "" |
| 89 | if os.path.exists("METADATA"): |
| 90 | with open("METADATA", "r") as inf: |
| 91 | for line in inf: |
| 92 | match = YMD_MATCHER.match(line) |
| 93 | if match: |
| 94 | if match.group(1) == "year": |
| 95 | year = match.group(2) |
| 96 | elif match.group(1) == "month": |
| 97 | month = match.group(2) |
| 98 | elif match.group(1) == "day": |
| 99 | day = match.group(2) |
| 100 | else: |
| 101 | match = YMD_LINE_MATCHER.match(line) |
| 102 | if match: |
| 103 | year, month, day = match.group(1), match.group(2), match.group(3) |
| 104 | if year and month and day: |
| 105 | print("### Reuse date in METADATA:", year, month, day) |
| 106 | return int(year), int(month), int(day) |
| 107 | today = datetime.date.today() |
| 108 | return today.year, today.month, today.day |
| 109 | |
| 110 | |
Thiébaud Weksteen | 8da4911 | 2021-02-19 11:59:49 +0100 | [diff] [blame] | 111 | def add_metadata(name, version, description, multi_license): |
Chih-Hung Hsieh | 3d24aed | 2020-10-05 15:29:11 -0700 | [diff] [blame] | 112 | """Update or add METADATA file.""" |
| 113 | if os.path.exists("METADATA"): |
| 114 | print("### Updating METADATA") |
| 115 | else: |
| 116 | print("### Adding METADATA") |
| 117 | year, month, day = get_metadata_date() |
Thiébaud Weksteen | 8da4911 | 2021-02-19 11:59:49 +0100 | [diff] [blame] | 118 | license_comment = "" |
| 119 | if multi_license: |
| 120 | license_comment = MULTI_LICENSE_COMMENT |
Chih-Hung Hsieh | 3d24aed | 2020-10-05 15:29:11 -0700 | [diff] [blame] | 121 | with open("METADATA", "w") as outf: |
| 122 | outf.write(METADATA_CONTENT.format( |
Thiébaud Weksteen | 8da4911 | 2021-02-19 11:59:49 +0100 | [diff] [blame] | 123 | name=name, description=description, version=version, |
| 124 | license_comment=license_comment, year=year, month=month, day=day)) |
Chih-Hung Hsieh | 3d24aed | 2020-10-05 15:29:11 -0700 | [diff] [blame] | 125 | |
| 126 | |
| 127 | def grep_license_keyword(license_file): |
| 128 | """Find familiar patterns in a file and return the type.""" |
| 129 | with open(license_file, "r") as input_file: |
| 130 | for line in input_file: |
| 131 | if APACHE_MATCHER.match(line): |
Thiébaud Weksteen | 8da4911 | 2021-02-19 11:59:49 +0100 | [diff] [blame] | 132 | return License(LicenseType.APACHE2, license_file) |
Chih-Hung Hsieh | 3d24aed | 2020-10-05 15:29:11 -0700 | [diff] [blame] | 133 | if MIT_MATCHER.match(line): |
Thiébaud Weksteen | 8da4911 | 2021-02-19 11:59:49 +0100 | [diff] [blame] | 134 | return License(LicenseType.MIT, license_file) |
Chih-Hung Hsieh | 3d24aed | 2020-10-05 15:29:11 -0700 | [diff] [blame] | 135 | if BSD_MATCHER.match(line): |
Thiébaud Weksteen | 8da4911 | 2021-02-19 11:59:49 +0100 | [diff] [blame] | 136 | return License(LicenseType.BSD_LIKE, license_file) |
Chih-Hung Hsieh | 3d24aed | 2020-10-05 15:29:11 -0700 | [diff] [blame] | 137 | print("ERROR: cannot decide license type in", license_file, |
Thiébaud Weksteen | 8da4911 | 2021-02-19 11:59:49 +0100 | [diff] [blame] | 138 | "assume BSD_LIKE") |
| 139 | return License(LicenseType.BSD_LIKE, license_file) |
| 140 | |
| 141 | |
| 142 | class LicenseType(enum.IntEnum): |
| 143 | """A type of license. |
| 144 | |
| 145 | An IntEnum is used to be able to sort by preference. This is mainly the case |
| 146 | for dual-licensed Apache/MIT code, for which we prefer the Apache license. |
| 147 | The enum name is used to generate the corresponding MODULE_LICENSE_* file. |
| 148 | """ |
| 149 | APACHE2 = 1 |
| 150 | MIT = 2 |
| 151 | BSD_LIKE = 3 |
| 152 | ISC = 4 |
| 153 | |
| 154 | |
| 155 | License = collections.namedtuple('License', ['type', 'filename']) |
Chih-Hung Hsieh | 3d24aed | 2020-10-05 15:29:11 -0700 | [diff] [blame] | 156 | |
| 157 | |
Chih-Hung Hsieh | 03f14e4 | 2020-10-19 18:38:30 -0700 | [diff] [blame] | 158 | def decide_license_type(cargo_license): |
Thiébaud Weksteen | 8da4911 | 2021-02-19 11:59:49 +0100 | [diff] [blame] | 159 | """Check LICENSE* files to determine the license type. |
| 160 | |
| 161 | Returns: A list of Licenses. The first element is the license we prefer. |
| 162 | """ |
Chih-Hung Hsieh | 3d24aed | 2020-10-05 15:29:11 -0700 | [diff] [blame] | 163 | # Most crates.io packages have both APACHE and MIT. |
Chih-Hung Hsieh | 03f14e4 | 2020-10-19 18:38:30 -0700 | [diff] [blame] | 164 | # Some crate like time-macros-impl uses lower case names like LICENSE-Apache. |
Thiébaud Weksteen | 8da4911 | 2021-02-19 11:59:49 +0100 | [diff] [blame] | 165 | licenses = [] |
| 166 | license_file = None |
| 167 | for license_file in glob.glob("LICENSE*"): |
Chih-Hung Hsieh | 03f14e4 | 2020-10-19 18:38:30 -0700 | [diff] [blame] | 168 | lowered_name = license_file.lower() |
| 169 | if lowered_name == "license-apache": |
Thiébaud Weksteen | 8da4911 | 2021-02-19 11:59:49 +0100 | [diff] [blame] | 170 | licenses.append(License(LicenseType.APACHE2, license_file)) |
Chih-Hung Hsieh | 03f14e4 | 2020-10-19 18:38:30 -0700 | [diff] [blame] | 171 | elif lowered_name == "license-mit": |
Thiébaud Weksteen | 8da4911 | 2021-02-19 11:59:49 +0100 | [diff] [blame] | 172 | licenses.append(License(LicenseType.MIT, license_file)) |
| 173 | if licenses: |
| 174 | licenses.sort(key=lambda l: l.type) |
| 175 | return licenses |
| 176 | if not license_file: |
| 177 | raise FileNotFoundError("No license file has been found.") |
| 178 | # There is a LICENSE or LICENSE.txt file, use cargo_license found in |
| 179 | # Cargo.toml. |
Chih-Hung Hsieh | 03f14e4 | 2020-10-19 18:38:30 -0700 | [diff] [blame] | 180 | if "Apache" in cargo_license: |
Thiébaud Weksteen | 8da4911 | 2021-02-19 11:59:49 +0100 | [diff] [blame] | 181 | return [License(LicenseType.APACHE2, license_file)] |
Chih-Hung Hsieh | 03f14e4 | 2020-10-19 18:38:30 -0700 | [diff] [blame] | 182 | if "MIT" in cargo_license: |
Thiébaud Weksteen | 8da4911 | 2021-02-19 11:59:49 +0100 | [diff] [blame] | 183 | return [License(LicenseType.MIT, license_file)] |
Chih-Hung Hsieh | 03f14e4 | 2020-10-19 18:38:30 -0700 | [diff] [blame] | 184 | if "BSD" in cargo_license: |
Thiébaud Weksteen | 8da4911 | 2021-02-19 11:59:49 +0100 | [diff] [blame] | 185 | return [License(LicenseType.BSD_LIKE, license_file)] |
Chih-Hung Hsieh | 03f14e4 | 2020-10-19 18:38:30 -0700 | [diff] [blame] | 186 | if "ISC" in cargo_license: |
Thiébaud Weksteen | 8da4911 | 2021-02-19 11:59:49 +0100 | [diff] [blame] | 187 | return [License(LicenseType.ISC, license_file)] |
| 188 | return [grep_license_keyword(license_file)] |
Chih-Hung Hsieh | 3d24aed | 2020-10-05 15:29:11 -0700 | [diff] [blame] | 189 | |
| 190 | |
| 191 | def add_notice(): |
| 192 | if not os.path.exists("NOTICE"): |
| 193 | if os.path.exists("LICENSE"): |
| 194 | os.symlink("LICENSE", "NOTICE") |
| 195 | print("Created link from NOTICE to LICENSE") |
| 196 | else: |
| 197 | print("ERROR: missing NOTICE and LICENSE") |
| 198 | |
| 199 | |
Chih-Hung Hsieh | 03f14e4 | 2020-10-19 18:38:30 -0700 | [diff] [blame] | 200 | def check_license_link(target): |
| 201 | """Check the LICENSE link, must bet the given target.""" |
Chih-Hung Hsieh | 3d24aed | 2020-10-05 15:29:11 -0700 | [diff] [blame] | 202 | if not os.path.islink("LICENSE"): |
| 203 | print("ERROR: LICENSE file is not a link") |
| 204 | return |
Chih-Hung Hsieh | 03f14e4 | 2020-10-19 18:38:30 -0700 | [diff] [blame] | 205 | found_target = os.readlink("LICENSE") |
| 206 | if target != found_target and found_target != "LICENSE.txt": |
| 207 | print("ERROR: found LICENSE link to", found_target, |
| 208 | "but expected", target) |
Chih-Hung Hsieh | 3d24aed | 2020-10-05 15:29:11 -0700 | [diff] [blame] | 209 | |
| 210 | |
Chih-Hung Hsieh | 03f14e4 | 2020-10-19 18:38:30 -0700 | [diff] [blame] | 211 | def add_license(target): |
| 212 | """Add LICENSE link to give target.""" |
Chih-Hung Hsieh | 3d24aed | 2020-10-05 15:29:11 -0700 | [diff] [blame] | 213 | if os.path.exists("LICENSE"): |
| 214 | if os.path.islink("LICENSE"): |
Chih-Hung Hsieh | 03f14e4 | 2020-10-19 18:38:30 -0700 | [diff] [blame] | 215 | check_license_link(target) |
Chih-Hung Hsieh | 3d24aed | 2020-10-05 15:29:11 -0700 | [diff] [blame] | 216 | else: |
Thiébaud Weksteen | 8da4911 | 2021-02-19 11:59:49 +0100 | [diff] [blame] | 217 | print("NOTE: found LICENSE and it is not a link.") |
Chih-Hung Hsieh | 3d24aed | 2020-10-05 15:29:11 -0700 | [diff] [blame] | 218 | return |
Chih-Hung Hsieh | 3d24aed | 2020-10-05 15:29:11 -0700 | [diff] [blame] | 219 | print("### Creating LICENSE link to", target) |
Chih-Hung Hsieh | 03f14e4 | 2020-10-19 18:38:30 -0700 | [diff] [blame] | 220 | os.symlink(target, "LICENSE") |
Chih-Hung Hsieh | 3d24aed | 2020-10-05 15:29:11 -0700 | [diff] [blame] | 221 | |
| 222 | |
| 223 | def add_module_license(license_type): |
| 224 | """Touch MODULE_LICENSE_type file.""" |
| 225 | # Do not change existing MODULE_* files. |
| 226 | for suffix in ["MIT", "APACHE", "APACHE2", "BSD_LIKE"]: |
| 227 | module_file = "MODULE_LICENSE_" + suffix |
| 228 | if os.path.exists(module_file): |
Thiébaud Weksteen | 8da4911 | 2021-02-19 11:59:49 +0100 | [diff] [blame] | 229 | if license_type.name != suffix: |
| 230 | raise Exception("Found unexpected license " + module_file) |
Chih-Hung Hsieh | 3d24aed | 2020-10-05 15:29:11 -0700 | [diff] [blame] | 231 | return |
Thiébaud Weksteen | 8da4911 | 2021-02-19 11:59:49 +0100 | [diff] [blame] | 232 | module_file = "MODULE_LICENSE_" + license_type.name.upper() |
Chih-Hung Hsieh | 3d24aed | 2020-10-05 15:29:11 -0700 | [diff] [blame] | 233 | pathlib.Path(module_file).touch() |
| 234 | print("### Touched", module_file) |
| 235 | |
| 236 | |
| 237 | def found_line(file_name, line): |
| 238 | """Returns true if the given line is found in a file.""" |
| 239 | with open(file_name, "r") as input_file: |
| 240 | return line in input_file |
| 241 | |
| 242 | |
| 243 | def add_owners(): |
| 244 | """Create or append OWNERS with the default owner line.""" |
| 245 | # Existing OWNERS file might contain more than the default owners. |
| 246 | # Only append missing default owners to existing OWNERS. |
| 247 | if os.path.isfile("OWNERS"): |
| 248 | if found_line("OWNERS", DEFAULT_OWNERS): |
| 249 | print("### No change to OWNERS, which has already default owners.") |
| 250 | return |
| 251 | else: |
| 252 | print("### Append default owners to OWNERS") |
| 253 | mode = "a" |
| 254 | else: |
| 255 | print("### Creating OWNERS with default owners") |
| 256 | mode = "w" |
| 257 | with open("OWNERS", mode) as outf: |
| 258 | outf.write(DEFAULT_OWNERS) |
| 259 | |
| 260 | |
| 261 | def toml2json(line): |
| 262 | """Convert a quoted toml string to a json quoted string for METADATA.""" |
| 263 | if line.startswith("\"\"\""): |
| 264 | return "\"()\"" # cannot handle broken multi-line description |
| 265 | # TOML string escapes: \b \t \n \f \r \" \\ (no unicode escape) |
| 266 | line = line[1:-1].replace("\\\\", "\n").replace("\\b", "") |
| 267 | line = line.replace("\\t", " ").replace("\\n", " ").replace("\\f", " ") |
| 268 | line = line.replace("\\r", "").replace("\\\"", "\"").replace("\n", "\\") |
| 269 | # replace a unicode quotation mark, used in the libloading crate |
| 270 | line = line.replace("’", "'") |
| 271 | # strip and escape single quotes |
| 272 | return json.dumps(line.strip()).replace("'", "\\'") |
| 273 | |
| 274 | |
| 275 | def parse_cargo_toml(cargo): |
Chih-Hung Hsieh | 03f14e4 | 2020-10-19 18:38:30 -0700 | [diff] [blame] | 276 | """get name, version, description, license string from Cargo.toml.""" |
Chih-Hung Hsieh | 3d24aed | 2020-10-05 15:29:11 -0700 | [diff] [blame] | 277 | name = "" |
| 278 | version = "" |
| 279 | description = "" |
Chih-Hung Hsieh | 03f14e4 | 2020-10-19 18:38:30 -0700 | [diff] [blame] | 280 | cargo_license = "" |
Chih-Hung Hsieh | 3d24aed | 2020-10-05 15:29:11 -0700 | [diff] [blame] | 281 | with open(cargo, "r") as toml: |
| 282 | for line in toml: |
Chih-Hung Hsieh | 03f14e4 | 2020-10-19 18:38:30 -0700 | [diff] [blame] | 283 | if not name and NAME_MATCHER.match(line): |
| 284 | name = NAME_MATCHER.match(line).group(1) |
| 285 | elif not version and VERSION_MATCHER.match(line): |
| 286 | version = VERSION_MATCHER.match(line).group(1) |
| 287 | elif not description and DESCRIPTION_MATCHER.match(line): |
| 288 | description = toml2json(DESCRIPTION_MATCHER.match(line).group(1)) |
| 289 | elif not cargo_license and LICENSE_MATCHER.match(line): |
| 290 | cargo_license = LICENSE_MATCHER.match(line).group(1) |
| 291 | if name and version and description and cargo_license: |
Chih-Hung Hsieh | 3d24aed | 2020-10-05 15:29:11 -0700 | [diff] [blame] | 292 | break |
Chih-Hung Hsieh | 03f14e4 | 2020-10-19 18:38:30 -0700 | [diff] [blame] | 293 | return name, version, description, cargo_license |
Chih-Hung Hsieh | 3d24aed | 2020-10-05 15:29:11 -0700 | [diff] [blame] | 294 | |
| 295 | |
| 296 | def main(): |
| 297 | """Add 3rd party review files.""" |
| 298 | cargo = "Cargo.toml" |
| 299 | if not os.path.isfile(cargo): |
| 300 | print("ERROR: ", cargo, "is not found") |
| 301 | return |
| 302 | if not os.access(cargo, os.R_OK): |
| 303 | print("ERROR: ", cargo, "is not readable") |
| 304 | return |
Chih-Hung Hsieh | 03f14e4 | 2020-10-19 18:38:30 -0700 | [diff] [blame] | 305 | name, version, description, cargo_license = parse_cargo_toml(cargo) |
Chih-Hung Hsieh | 3d24aed | 2020-10-05 15:29:11 -0700 | [diff] [blame] | 306 | if not name or not version or not description: |
| 307 | print("ERROR: Cannot find name, version, or description in", cargo) |
| 308 | return |
Chih-Hung Hsieh | 03f14e4 | 2020-10-19 18:38:30 -0700 | [diff] [blame] | 309 | print("### Cargo.toml license:", cargo_license) |
Thiébaud Weksteen | 8da4911 | 2021-02-19 11:59:49 +0100 | [diff] [blame] | 310 | licenses = decide_license_type(cargo_license) |
| 311 | preferred_license = licenses[0] |
| 312 | add_metadata(name, version, description, len(licenses) > 1) |
Chih-Hung Hsieh | 3d24aed | 2020-10-05 15:29:11 -0700 | [diff] [blame] | 313 | add_owners() |
Thiébaud Weksteen | 8da4911 | 2021-02-19 11:59:49 +0100 | [diff] [blame] | 314 | add_license(preferred_license.filename) |
| 315 | add_module_license(preferred_license.type) |
Chih-Hung Hsieh | 3d24aed | 2020-10-05 15:29:11 -0700 | [diff] [blame] | 316 | # It is unclear yet if a NOTICE file is required. |
| 317 | # add_notice() |
| 318 | |
| 319 | |
| 320 | if __name__ == "__main__": |
| 321 | main() |