Skip to content

Commit a6d841f

Browse files
author
hornik
committed
Have analyze_license() compute SPDX license identifiers.
With Thierry Onkelinx and Lluis Revilla. git-svn-id: https://svn.r-project.org/R/trunk@88237 00db46b3-68df-0310-9c12-caf00c1e9a41
1 parent 9f7821e commit a6d841f

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

src/library/tools/R/license.R

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -466,7 +466,8 @@ function(x)
466466
extensions = NULL,
467467
pointers = NULL,
468468
is_FOSS = NA,
469-
restricts_use = NA)
469+
restricts_use = NA,
470+
spdx = "")
470471
list(is_empty = is_empty,
471472
is_canonical = is_canonical,
472473
bad_components = bad_components,
@@ -478,7 +479,8 @@ function(x)
478479
extensions = extensions,
479480
pointers = pointers,
480481
is_FOSS = is_FOSS,
481-
restricts_use = restricts_use)
482+
restricts_use = restricts_use,
483+
spdx = spdx)
482484

483485

484486
x <- trimws(x)
@@ -495,6 +497,7 @@ function(x)
495497
is_verified <- FALSE
496498
is_FOSS <- NA
497499
restricts_use <- NA
500+
spdx <- ""
498501

499502
## Try splitting into the individual components.
500503
components <-
@@ -611,6 +614,9 @@ function(x)
611614
stringsAsFactors = FALSE)
612615
}
613616

617+
spdx <- paste(unique(unlist(lapply(expansions, `[[`, "SPDX"),
618+
use.names = FALSE)),
619+
collapse = " OR ")
614620
## Replace expansions by their labels from the license db.
615621
## (As these are unique, we can always easily get the full
616622
## expansions back.)
@@ -642,7 +648,8 @@ function(x)
642648
extensions = extensions,
643649
pointers = pointers,
644650
is_FOSS = is_FOSS,
645-
restricts_use = restricts_use)
651+
restricts_use = restricts_use,
652+
spdx = spdx)
646653
}
647654

648655
.standardize_license_components <-

0 commit comments

Comments
 (0)