diff --git a/README.md b/README.md index 9b57eb9..65a7d67 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ [![Crates.io](https://img.shields.io/crates/v/cargo-about.svg)](https://crates.io/crates/cargo-about) [![API Docs](https://docs.rs/cargo-about/badge.svg)](https://docs.rs/cargo-about) [![SPDX Version](https://img.shields.io/badge/SPDX%20Version-3.25.0-blue.svg)](https://spdx.org/licenses/) -[![Minimum Stable Rust Version](https://img.shields.io/badge/Rust-1.74.0-blue?color=fc8d62&logo=rust)](https://github.com/rust-lang/rust/blob/master/RELEASES.md#version-1740-2023-11-16) +[![Minimum Stable Rust Version](https://img.shields.io/badge/Rust-1.81.0-blue?color=fc8d62&logo=rust)](https://github.com/rust-lang/rust/blob/master/RELEASES.md#version-1810-2024-09-05) [![dependency status](https://deps.rs/repo/github/EmbarkStudios/cargo-about/status.svg)](https://deps.rs/repo/github/EmbarkStudios/cargo-about) [![Build Status](https://github.com/EmbarkStudios/cargo-about/workflows/CI/badge.svg)](https://github.com/EmbarkStudios/cargo-about/actions?workflow=CI) diff --git a/about.toml b/about.toml index 74b9fef..666166a 100644 --- a/about.toml +++ b/about.toml @@ -12,7 +12,7 @@ ignore-build-dependencies = false ignore-dev-dependencies = false ignore-transitive-dependencies = false filter-noassertion = true -workarounds = ["ring", "chrono", "rustls"] +workarounds = ["ring", "chrono", "rustls", "unicode-ident"] [codespan.clarify] license = "Apache-2.0" diff --git a/src/cargo-about/clarify.rs b/src/cargo-about/clarify.rs index d82d46f..071607f 100644 --- a/src/cargo-about/clarify.rs +++ b/src/cargo-about/clarify.rs @@ -71,7 +71,7 @@ pub fn cmd(args: Args) -> anyhow::Result<()> { let root = PathBuf::from_path_buf( home::cargo_home() .context("unable to find CARGO_HOME directory")? - .join("registry/src/github.com-1ecc6299db9ec823"), + .join("registry/src/index.crates.io-6f17d22bba15001f"), ) .map_err(|_e| anyhow::anyhow!("CARGO_HOME directory is not utf-8"))?; diff --git a/src/licenses/workarounds.rs b/src/licenses/workarounds.rs index 9e6f474..f6a8324 100644 --- a/src/licenses/workarounds.rs +++ b/src/licenses/workarounds.rs @@ -15,6 +15,7 @@ mod rustls; mod sentry; mod tonic; mod tract; +mod unicode_ident; mod wasmtime; pub(crate) fn apply_workarounds<'krate>( @@ -88,5 +89,6 @@ const WORKAROUNDS: &[( ("sentry", &self::sentry::get), ("tonic", &self::tonic::get), ("tract", &self::tract::get), + ("unicode-ident", &self::unicode_ident::get), ("wasmtime", &self::wasmtime::get), ]; diff --git a/src/licenses/workarounds/unicode_ident.rs b/src/licenses/workarounds/unicode_ident.rs new file mode 100644 index 0000000..3a50535 --- /dev/null +++ b/src/licenses/workarounds/unicode_ident.rs @@ -0,0 +1,49 @@ +use super::ClarificationFile; +use anyhow::Context as _; + +pub fn get(krate: &crate::Krate) -> anyhow::Result> { + if krate.name != "unicode-ident" { + return Ok(None); + } + + Ok(Some(super::Clarification { + license: spdx::Expression::parse("(MIT OR Apache-2.0) AND Unicode-DFS-2016") + .context("failed to parse license expression")?, + override_git_commit: None, + git: Vec::new(), + files: vec![ + ClarificationFile { + path: "LICENSE-UNICODE".into(), + license: Some( + spdx::Expression::parse("Unicode-DFS-2016") + .context("failed to parse license expression")?, + ), + checksum: "68f5b9f5ea36881a0942ba02f558e9e1faf76cc09cb165ad801744c61b738844" + .to_owned(), + start: None, + end: None, + }, + ClarificationFile { + path: "LICENSE-APACHE".into(), + license: Some( + spdx::Expression::parse("Apache-2.0") + .context("failed to parse license expression")?, + ), + checksum: "62c7a1e35f56406896d7aa7ca52d0cc0d272ac022b5d2796e7d6905db8a3636a" + .to_owned(), + start: None, + end: None, + }, + ClarificationFile { + path: "LICENSE-MIT".into(), + license: Some( + spdx::Expression::parse("MIT").context("failed to parse license expression")?, + ), + checksum: "23f18e03dc49df91622fe2a76176497404e46ced8a715d9d2b67a7446571cca3" + .to_owned(), + start: None, + end: None, + }, + ], + })) +}