From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 7F63815800F for ; Wed, 4 Jan 2023 19:51:33 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id D1243E0794; Wed, 4 Jan 2023 19:51:31 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id B3359E0794 for ; Wed, 4 Jan 2023 19:51:31 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 7C881340ED0 for ; Wed, 4 Jan 2023 19:51:30 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 8B19075E for ; Wed, 4 Jan 2023 19:51:28 +0000 (UTC) From: "Georgy Yakovlev" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Georgy Yakovlev" Message-ID: <1672861866.9a2b4139a1d57fec1b21a363c5a6089133d002a8.gyakovlev@gentoo> Subject: [gentoo-commits] proj/cargo-ebuild:master commit in: src/ X-VCS-Repository: proj/cargo-ebuild X-VCS-Files: src/lib.rs src/license.rs X-VCS-Directories: src/ X-VCS-Committer: gyakovlev X-VCS-Committer-Name: Georgy Yakovlev X-VCS-Revision: 9a2b4139a1d57fec1b21a363c5a6089133d002a8 X-VCS-Branch: master Date: Wed, 4 Jan 2023 19:51:28 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: 32a74190-6e6c-4384-b95e-2cd507f9db55 X-Archives-Hash: fad78f789b79e4fd4db8e64ad203b3d3 commit: 9a2b4139a1d57fec1b21a363c5a6089133d002a8 Author: Leonardo Neumann neumann dev br> AuthorDate: Fri Nov 11 17:01:52 2022 +0000 Commit: Georgy Yakovlev gentoo org> CommitDate: Wed Jan 4 19:51:06 2023 +0000 URL: https://gitweb.gentoo.org/proj/cargo-ebuild.git/commit/?id=9a2b4139 Ignore SPDX parentheses and add crate name to the license error message Closes: https://github.com/gentoo/cargo-ebuild/issues/27 Closes: https://github.com/gentoo/cargo-ebuild/pull/28 Signed-off-by: Leonardo Neumann neumann.dev.br> Signed-off-by: Georgy Yakovlev gentoo.org> src/lib.rs | 5 +++-- src/license.rs | 3 +++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index 94ebf71..ec214c8 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -78,8 +78,9 @@ pub fn gen_ebuild_data( manifest_path: Option<&Path> } else { // Add the unknown license name to be corrected manually println!( - "WARNING: unknown license \"{}\", please correct manually", - &lic + "WARNING: unknown license \"{}\" at package \"{}\", please correct manually", + &lic, + &pkg.name, ); licenses.insert(lic.to_string()); } diff --git a/src/license.rs b/src/license.rs index f4a397f..99d5278 100644 --- a/src/license.rs +++ b/src/license.rs @@ -160,6 +160,9 @@ pub fn split_spdx_license(str: &str) -> Vec<&str> { str.split('/') .flat_map(|l| l.split(" OR ")) .flat_map(|l| l.split(" AND ")) + .flat_map(|l| l.split("(")) + .flat_map(|l| l.split(")")) + .filter(|l| !l.is_empty()) .map(str::trim) .collect() }