Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

<!-- next-header -->
## [Unreleased] - ReleaseDate
### Changed
- [PR#86](https://github.com/EmbarkStudios/spdx/pull/86) changes the license detection for GNU licenses (GPL, AGPL, LGPL, GFDL). In 0.13.0 they would be detected as their deprecated (eg. `AGPL-3.0`) variant due to the variants (root, `-only`, and `-or-later`) using the exact same license text. GNU licenses are now detected as the `<root>-or-later` version. This is an arbitrary decision, which I hope to not change, but if someone makes a convincing argument it could be.

## [0.13.0] - 2025-12-02
### Added
- [PR#84](https://github.com/EmbarkStudios/spdx/pull/84) resolved [#67](https://github.com/EmbarkStudios/spdx/issues/67) by inlining the `askalono` crate to allow detection of license texts or headers from arbitrary text data. There are multiple features flags associated with this new feature.
Expand Down
4 changes: 2 additions & 2 deletions src/detection/cache.bin.zstd
Git LFS file not shown
3 changes: 2 additions & 1 deletion src/identifiers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
* cargo run --manifest-path update/Cargo.toml -- v<version> > src/identifiers.rs
*/

use crate::{Exception, License, flags::*};
use crate::flags::*;
use crate::{Exception, License};

pub const VERSION: &str = "3.27.0";

Expand Down
139 changes: 53 additions & 86 deletions src/text.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
pub const LICENSE_TEXTS: &[(&str, &str)] = &[
("NOASSERTION", ""),
("0BSD", include!("text/licenses/0BSD")),
("3D-Slicer-1.0", include!("text/licenses/3D-Slicer-1.0")),
("AAL", include!("text/licenses/AAL")),
Expand All @@ -9,17 +10,11 @@ pub const LICENSE_TEXTS: &[(&str, &str)] = &[
("AFL-2.1", include!("text/licenses/AFL-2.1")),
("AFL-3.0", include!("text/licenses/AFL-3.0")),
("AGPL-1.0", include!("text/licenses/AGPL-1.0")),
("AGPL-1.0-only", include!("text/licenses/AGPL-1.0-only")),
(
"AGPL-1.0-or-later",
include!("text/licenses/AGPL-1.0-or-later"),
),
("AGPL-1.0-only", include!("text/licenses/AGPL-1.0")),
("AGPL-1.0-or-later", include!("text/licenses/AGPL-1.0")),
("AGPL-3.0", include!("text/licenses/AGPL-3.0")),
("AGPL-3.0-only", include!("text/licenses/AGPL-3.0-only")),
(
"AGPL-3.0-or-later",
include!("text/licenses/AGPL-3.0-or-later"),
),
("AGPL-3.0-only", include!("text/licenses/AGPL-3.0")),
("AGPL-3.0-or-later", include!("text/licenses/AGPL-3.0")),
("AMD-newlib", include!("text/licenses/AMD-newlib")),
("AMDPLPA", include!("text/licenses/AMDPLPA")),
("AML", include!("text/licenses/AML")),
Expand Down Expand Up @@ -215,7 +210,7 @@ pub const LICENSE_TEXTS: &[(&str, &str)] = &[
("CAL-1.0", include!("text/licenses/CAL-1.0")),
(
"CAL-1.0-Combined-Work-Exception",
include!("text/licenses/CAL-1.0-Combined-Work-Exception"),
include!("text/licenses/CAL-1.0"),
),
("CATOSL-1.1", include!("text/licenses/CATOSL-1.1")),
("CC-BY-1.0", include!("text/licenses/CC-BY-1.0")),
Expand Down Expand Up @@ -417,110 +412,95 @@ pub const LICENSE_TEXTS: &[(&str, &str)] = &[
("GD", include!("text/licenses/GD")),
("GFDL-1.1", include!("text/licenses/GFDL-1.1")),
(
"GFDL-1.1-invariants",
include!("text/licenses/GFDL-1.1-invariants-only"),
"GFDL-1.1-invariants-only",
include!("text/licenses/GFDL-1.1"),
),
(
"GFDL-1.1-invariants-only",
include!("text/licenses/GFDL-1.1-invariants-only"),
include!("text/licenses/GFDL-1.1"),
),
(
"GFDL-1.1-invariants-or-later",
include!("text/licenses/GFDL-1.1-invariants-or-later"),
include!("text/licenses/GFDL-1.1"),
),
(
"GFDL-1.1-no-invariants",
include!("text/licenses/GFDL-1.1-no-invariants-only"),
"GFDL-1.1-no-invariants-only",
include!("text/licenses/GFDL-1.1"),
),
(
"GFDL-1.1-no-invariants-only",
include!("text/licenses/GFDL-1.1-no-invariants-only"),
include!("text/licenses/GFDL-1.1"),
),
(
"GFDL-1.1-no-invariants-or-later",
include!("text/licenses/GFDL-1.1-no-invariants-or-later"),
),
("GFDL-1.1-only", include!("text/licenses/GFDL-1.1-only")),
(
"GFDL-1.1-or-later",
include!("text/licenses/GFDL-1.1-or-later"),
include!("text/licenses/GFDL-1.1"),
),
("GFDL-1.1-only", include!("text/licenses/GFDL-1.1")),
("GFDL-1.1-or-later", include!("text/licenses/GFDL-1.1")),
("GFDL-1.2", include!("text/licenses/GFDL-1.2")),
(
"GFDL-1.2-invariants",
include!("text/licenses/GFDL-1.2-invariants-only"),
"GFDL-1.2-invariants-only",
include!("text/licenses/GFDL-1.2"),
),
(
"GFDL-1.2-invariants-only",
include!("text/licenses/GFDL-1.2-invariants-only"),
include!("text/licenses/GFDL-1.2"),
),
(
"GFDL-1.2-invariants-or-later",
include!("text/licenses/GFDL-1.2-invariants-or-later"),
include!("text/licenses/GFDL-1.2"),
),
(
"GFDL-1.2-no-invariants",
include!("text/licenses/GFDL-1.2-no-invariants-only"),
"GFDL-1.2-no-invariants-only",
include!("text/licenses/GFDL-1.2"),
),
(
"GFDL-1.2-no-invariants-only",
include!("text/licenses/GFDL-1.2-no-invariants-only"),
include!("text/licenses/GFDL-1.2"),
),
(
"GFDL-1.2-no-invariants-or-later",
include!("text/licenses/GFDL-1.2-no-invariants-or-later"),
),
("GFDL-1.2-only", include!("text/licenses/GFDL-1.2-only")),
(
"GFDL-1.2-or-later",
include!("text/licenses/GFDL-1.2-or-later"),
include!("text/licenses/GFDL-1.2"),
),
("GFDL-1.2-only", include!("text/licenses/GFDL-1.2")),
("GFDL-1.2-or-later", include!("text/licenses/GFDL-1.2")),
("GFDL-1.3", include!("text/licenses/GFDL-1.3")),
(
"GFDL-1.3-invariants",
include!("text/licenses/GFDL-1.3-invariants-only"),
"GFDL-1.3-invariants-only",
include!("text/licenses/GFDL-1.3"),
),
(
"GFDL-1.3-invariants-only",
include!("text/licenses/GFDL-1.3-invariants-only"),
include!("text/licenses/GFDL-1.3"),
),
(
"GFDL-1.3-invariants-or-later",
include!("text/licenses/GFDL-1.3-invariants-or-later"),
include!("text/licenses/GFDL-1.3"),
),
(
"GFDL-1.3-no-invariants",
include!("text/licenses/GFDL-1.3-no-invariants-only"),
"GFDL-1.3-no-invariants-only",
include!("text/licenses/GFDL-1.3"),
),
(
"GFDL-1.3-no-invariants-only",
include!("text/licenses/GFDL-1.3-no-invariants-only"),
include!("text/licenses/GFDL-1.3"),
),
(
"GFDL-1.3-no-invariants-or-later",
include!("text/licenses/GFDL-1.3-no-invariants-or-later"),
),
("GFDL-1.3-only", include!("text/licenses/GFDL-1.3-only")),
(
"GFDL-1.3-or-later",
include!("text/licenses/GFDL-1.3-or-later"),
include!("text/licenses/GFDL-1.3"),
),
("GFDL-1.3-only", include!("text/licenses/GFDL-1.3")),
("GFDL-1.3-or-later", include!("text/licenses/GFDL-1.3")),
("GL2PS", include!("text/licenses/GL2PS")),
("GLWTPL", include!("text/licenses/GLWTPL")),
("GPL-1.0", include!("text/licenses/GPL-1.0")),
("GPL-1.0-only", include!("text/licenses/GPL-1.0")),
("GPL-1.0-or-later", include!("text/licenses/GPL-1.0")),
("GPL-1.0+", include!("text/licenses/GPL-1.0+")),
("GPL-1.0-only", include!("text/licenses/GPL-1.0-only")),
(
"GPL-1.0-or-later",
include!("text/licenses/GPL-1.0-or-later"),
),
("GPL-2.0", include!("text/licenses/GPL-2.0")),
("GPL-2.0-only", include!("text/licenses/GPL-2.0")),
("GPL-2.0-or-later", include!("text/licenses/GPL-2.0")),
("GPL-2.0+", include!("text/licenses/GPL-2.0+")),
("GPL-2.0-only", include!("text/licenses/GPL-2.0-only")),
(
"GPL-2.0-or-later",
include!("text/licenses/GPL-2.0-or-later"),
),
(
"GPL-2.0-with-GCC-exception",
include!("text/licenses/GPL-2.0-with-GCC-exception"),
Expand All @@ -542,12 +522,9 @@ pub const LICENSE_TEXTS: &[(&str, &str)] = &[
include!("text/licenses/GPL-2.0-with-font-exception"),
),
("GPL-3.0", include!("text/licenses/GPL-3.0")),
("GPL-3.0-only", include!("text/licenses/GPL-3.0")),
("GPL-3.0-or-later", include!("text/licenses/GPL-3.0")),
("GPL-3.0+", include!("text/licenses/GPL-3.0+")),
("GPL-3.0-only", include!("text/licenses/GPL-3.0-only")),
(
"GPL-3.0-or-later",
include!("text/licenses/GPL-3.0-or-later"),
),
(
"GPL-3.0-with-GCC-exception",
include!("text/licenses/GPL-3.0-with-GCC-exception"),
Expand Down Expand Up @@ -666,26 +643,17 @@ pub const LICENSE_TEXTS: &[(&str, &str)] = &[
("LAL-1.2", include!("text/licenses/LAL-1.2")),
("LAL-1.3", include!("text/licenses/LAL-1.3")),
("LGPL-2.0", include!("text/licenses/LGPL-2.0")),
("LGPL-2.0-only", include!("text/licenses/LGPL-2.0")),
("LGPL-2.0-or-later", include!("text/licenses/LGPL-2.0")),
("LGPL-2.0+", include!("text/licenses/LGPL-2.0+")),
("LGPL-2.0-only", include!("text/licenses/LGPL-2.0-only")),
(
"LGPL-2.0-or-later",
include!("text/licenses/LGPL-2.0-or-later"),
),
("LGPL-2.1", include!("text/licenses/LGPL-2.1")),
("LGPL-2.1-only", include!("text/licenses/LGPL-2.1")),
("LGPL-2.1-or-later", include!("text/licenses/LGPL-2.1")),
("LGPL-2.1+", include!("text/licenses/LGPL-2.1+")),
("LGPL-2.1-only", include!("text/licenses/LGPL-2.1-only")),
(
"LGPL-2.1-or-later",
include!("text/licenses/LGPL-2.1-or-later"),
),
("LGPL-3.0", include!("text/licenses/LGPL-3.0")),
("LGPL-3.0-only", include!("text/licenses/LGPL-3.0")),
("LGPL-3.0-or-later", include!("text/licenses/LGPL-3.0")),
("LGPL-3.0+", include!("text/licenses/LGPL-3.0+")),
("LGPL-3.0-only", include!("text/licenses/LGPL-3.0-only")),
(
"LGPL-3.0-or-later",
include!("text/licenses/LGPL-3.0-or-later"),
),
("LGPLLR", include!("text/licenses/LGPLLR")),
("LOOP", include!("text/licenses/LOOP")),
("LPD-document", include!("text/licenses/LPD-document")),
Expand Down Expand Up @@ -757,7 +725,7 @@ pub const LICENSE_TEXTS: &[(&str, &str)] = &[
("MPL-2.0", include!("text/licenses/MPL-2.0")),
(
"MPL-2.0-no-copyleft-exception",
include!("text/licenses/MPL-2.0-no-copyleft-exception"),
include!("text/licenses/MPL-2.0"),
),
("MS-LPL", include!("text/licenses/MS-LPL")),
("MS-PL", include!("text/licenses/MS-PL")),
Expand Down Expand Up @@ -805,7 +773,6 @@ pub const LICENSE_TEXTS: &[(&str, &str)] = &[
("NLOD-1.0", include!("text/licenses/NLOD-1.0")),
("NLOD-2.0", include!("text/licenses/NLOD-2.0")),
("NLPL", include!("text/licenses/NLPL")),
("NOASSERTION", ""),
("NOSL", include!("text/licenses/NOSL")),
("NPL-1.0", include!("text/licenses/NPL-1.0")),
("NPL-1.1", include!("text/licenses/NPL-1.1")),
Expand All @@ -829,11 +796,11 @@ pub const LICENSE_TEXTS: &[(&str, &str)] = &[
("ODbL-1.0", include!("text/licenses/ODbL-1.0")),
("OFFIS", include!("text/licenses/OFFIS")),
("OFL-1.0", include!("text/licenses/OFL-1.0")),
("OFL-1.0-RFN", include!("text/licenses/OFL-1.0-RFN")),
("OFL-1.0-no-RFN", include!("text/licenses/OFL-1.0-no-RFN")),
("OFL-1.0-RFN", include!("text/licenses/OFL-1.0")),
("OFL-1.0-no-RFN", include!("text/licenses/OFL-1.0")),
("OFL-1.1", include!("text/licenses/OFL-1.1")),
("OFL-1.1-RFN", include!("text/licenses/OFL-1.1-RFN")),
("OFL-1.1-no-RFN", include!("text/licenses/OFL-1.1-no-RFN")),
("OFL-1.1-RFN", include!("text/licenses/OFL-1.1")),
("OFL-1.1-no-RFN", include!("text/licenses/OFL-1.1")),
("OGC-1.0", include!("text/licenses/OGC-1.0")),
("OGDL-Taiwan-1.0", include!("text/licenses/OGDL-Taiwan-1.0")),
("OGL-Canada-2.0", include!("text/licenses/OGL-Canada-2.0")),
Expand Down
Loading