From c9b5fbb58ddde97cba698ca865e495639238c246 Mon Sep 17 00:00:00 2001 From: Michael Olbrich Date: Mon, 30 Nov 2015 19:09:09 +0100 Subject: license: handle SPDX composite license expressions Signed-off-by: Michael Olbrich --- scripts/lib/ptxd_make_license_report.sh | 6 ++++++ scripts/lib/ptxd_make_world_license.sh | 9 +++++++-- 2 files changed, 13 insertions(+), 2 deletions(-) (limited to 'scripts') diff --git a/scripts/lib/ptxd_make_license_report.sh b/scripts/lib/ptxd_make_license_report.sh index d2083df91..04c2e233b 100644 --- a/scripts/lib/ptxd_make_license_report.sh +++ b/scripts/lib/ptxd_make_license_report.sh @@ -34,6 +34,7 @@ ptxd_make_license_report_header() { \licensereporttrue \makeindex[name=attribution,intoc,title=attribution Package Index] + \makeindex[name=choice,intoc,title=choice Package Index] \makeindex[name=nosource,intoc,title=nosource Package Index] \makeindex[name=nopatches,intoc,title=nopatches Package Index] @@ -96,8 +97,13 @@ ptxd_make_license_report_footer() { Packages marked with the {\it attribution} flag require some sort of attribution. Please refer to the package license for further details. + \section{choice\label{choice}} + Packages marked with the {\it choice} flag require the licensee to + make some kind of license choice. Please refer to the package + license for further details. \printindex[attribution] + \printindex[choice] \printindex[nosource] \printindex[nopatches] diff --git a/scripts/lib/ptxd_make_world_license.sh b/scripts/lib/ptxd_make_world_license.sh index a6743c134..ccfaf51d4 100644 --- a/scripts/lib/ptxd_make_world_license.sh +++ b/scripts/lib/ptxd_make_world_license.sh @@ -284,7 +284,7 @@ ptxd_create_section_from_license() { local -A section local orig_IFS="${IFS}" - IFS=$', ' + IFS=$'(), ' for license in ${1}; do local osi="false" @@ -313,6 +313,8 @@ ptxd_create_section_from_license() echo ignore return 0 ;; + AND|OR|WITH|"") + ;; *) section[other]="true" ;; @@ -346,7 +348,7 @@ export -f ptxd_make_world_license_add_flag ptxd_make_world_license_flags() { local orig_IFS="${IFS}" - IFS=$', ' + IFS=$'(), ' for license in ${pkg_license}; do case "${license}" in @@ -360,6 +362,9 @@ ptxd_make_world_license_flags() { nosource|nopatches|attribution) ptxd_make_world_license_add_flag "${license}" ;; + OR) + ptxd_make_world_license_add_flag choice + ;; esac done -- cgit v1.2.3