After commit [spdx 3.0: Rework how SPDX aliases are linked] applied, it set
license_text_map with alias other than actual spdxId

The property of simplelicensing_customIdToUri is 
ListProp(ObjectProp(DictionaryEntry))),
and class DictionaryEntry has key and value, the property of value is 
StringProp other
than ObjectProp in which could not support to decode/extract alias with actual 
spdxId in
image jsonld file

$ bitbake core-image-minimal
$ vim 
tmp/deploy/images/qemux86-64/core-image-minimal-qemux86-64.rootfs.spdx.json
...
      "simplelicensing_customIdToUri": [
        {
          "type": "DictionaryEntry",
          "key": "LicenseRef-PD",
          "value": 
"http://spdxdocs.org/openembedded-alias/by-doc-hash/d53e90e23b12c4ad640809a74a810e86f31c76cdbdf36487712d22a33d53362a/sqlite3-native/UNIHASH/license-text/PD";
        }
      ],
...

After applying this commit, revert [spdx 3.0: Rework how SPDX aliases are 
linked]
to set actual spdxId other than alias to dictionary license_text_map
...
      "simplelicensing_customIdToUri": [
        {
          "type": "DictionaryEntry",
          "key": "LicenseRef-PD",
          "value": 
"http://spdx.org/spdxdocs/sqlite3-native-e5cc0672-d8dd-57e8-a2df-fe4615831fda/162c62b5b011cd3f82f413b3dae4d6d1542201552c964d5ce69fe170e0720b85/license-text/PD";
        }
      ]
...

Signed-off-by: Hongxu Jia <hongxu....@windriver.com>
---
 meta/lib/oe/spdx30_tasks.py | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/meta/lib/oe/spdx30_tasks.py b/meta/lib/oe/spdx30_tasks.py
index 036c58bf4b..82fcfe7a63 100644
--- a/meta/lib/oe/spdx30_tasks.py
+++ b/meta/lib/oe/spdx30_tasks.py
@@ -107,9 +107,7 @@ def add_license_expression(d, objset, license_expression, 
license_data):
 
         spdx_license = "LicenseRef-" + l
         if spdx_license not in license_text_map:
-            license_text_map[spdx_license] = oe.sbom30.get_element_link_id(
-                add_license_text(l)
-            )
+            license_text_map[spdx_license] = add_license_text(l)._id
 
         return spdx_license
 
-- 
2.25.1

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#208630): 
https://lists.openembedded.org/g/openembedded-core/message/208630
Mute This Topic: https://lists.openembedded.org/mt/110077885/21656
Group Owner: openembedded-core+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to