From 3e8e4b9cadc991f3ad451f43605b12e768c254f4 Mon Sep 17 00:00:00 2001 From: Anders Kaseorg Date: Sun, 18 Oct 2020 22:05:17 -0700 Subject: [PATCH] check-thirdparty: Work around deficient Mypy annotations for debian. Signed-off-by: Anders Kaseorg --- tools/check-thirdparty | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/tools/check-thirdparty b/tools/check-thirdparty index fc0f0b0175..4cd1060fcc 100755 --- a/tools/check-thirdparty +++ b/tools/check-thirdparty @@ -36,7 +36,9 @@ if not c.header.known_format(): status = 1 defined_licenses = { - p.license.synopsis for p in c.all_license_paragraphs() if p.license.text + p.license.to_str().split("\n", 1)[0] + for p in c.all_license_paragraphs() + if "\n" in p.license.to_str() } for p in c.all_files_paragraphs(): @@ -45,8 +47,8 @@ for p in c.all_files_paragraphs(): print(f"{COPYRIGHT_FILENAME}: No such file {g}") status = 1 - if not p.license.text and p.license.synopsis not in defined_licenses: - print(f"{COPYRIGHT_FILENAME}: Missing license text for {p.license.synopsis}") + if "\n" not in p.license.to_str() and p.license.to_str() not in defined_licenses: + print(f"{COPYRIGHT_FILENAME}: Missing license text for {p.license.to_str()}") status = 1 dumped = c.dump()