diff options
Diffstat (limited to 'meta/classes/create-spdx.bbclass')
| -rw-r--r-- | meta/classes/create-spdx.bbclass | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/meta/classes/create-spdx.bbclass b/meta/classes/create-spdx.bbclass index daf99ca676..1a4804a7c5 100644 --- a/meta/classes/create-spdx.bbclass +++ b/meta/classes/create-spdx.bbclass | |||
| @@ -94,7 +94,7 @@ def convert_license_to_spdx(lic, document, d, existing={}): | |||
| 94 | from pathlib import Path | 94 | from pathlib import Path |
| 95 | import oe.spdx | 95 | import oe.spdx |
| 96 | 96 | ||
| 97 | available_licenses = d.getVar("AVAILABLE_LICENSES").split() | 97 | avail_licenses = available_licenses(d) |
| 98 | license_data = d.getVar("SPDX_LICENSE_DATA") | 98 | license_data = d.getVar("SPDX_LICENSE_DATA") |
| 99 | extracted = {} | 99 | extracted = {} |
| 100 | 100 | ||
| @@ -112,7 +112,7 @@ def convert_license_to_spdx(lic, document, d, existing={}): | |||
| 112 | if name == "PD": | 112 | if name == "PD": |
| 113 | # Special-case this. | 113 | # Special-case this. |
| 114 | extracted_info.extractedText = "Software released to the public domain" | 114 | extracted_info.extractedText = "Software released to the public domain" |
| 115 | elif name in available_licenses: | 115 | elif name in avail_licenses: |
| 116 | # This license can be found in COMMON_LICENSE_DIR or LICENSE_PATH | 116 | # This license can be found in COMMON_LICENSE_DIR or LICENSE_PATH |
| 117 | for directory in [d.getVar('COMMON_LICENSE_DIR')] + (d.getVar('LICENSE_PATH') or '').split(): | 117 | for directory in [d.getVar('COMMON_LICENSE_DIR')] + (d.getVar('LICENSE_PATH') or '').split(): |
| 118 | try: | 118 | try: |
| @@ -122,11 +122,11 @@ def convert_license_to_spdx(lic, document, d, existing={}): | |||
| 122 | except FileNotFoundError: | 122 | except FileNotFoundError: |
| 123 | pass | 123 | pass |
| 124 | if extracted_info.extractedText is None: | 124 | if extracted_info.extractedText is None: |
| 125 | # Error out, as the license was in available_licenses so should | 125 | # Error out, as the license was in avail_licenses so should |
| 126 | # be on disk somewhere. | 126 | # be on disk somewhere. |
| 127 | bb.error("Cannot find text for license %s" % name) | 127 | bb.error("Cannot find text for license %s" % name) |
| 128 | else: | 128 | else: |
| 129 | # If it's not SPDX, or PD, or in available licenses, then NO_GENERIC_LICENSE must be set | 129 | # If it's not SPDX, or PD, or in avail_licenses, then NO_GENERIC_LICENSE must be set |
| 130 | filename = d.getVarFlag('NO_GENERIC_LICENSE', name) | 130 | filename = d.getVarFlag('NO_GENERIC_LICENSE', name) |
| 131 | if filename: | 131 | if filename: |
| 132 | filename = d.expand("${S}/" + filename) | 132 | filename = d.expand("${S}/" + filename) |
