The deduplicate logic has a logic flaw in that it was scanning over all
deduplicated items from previous calls to find_deduplicates(). This
doesn't make any sense because the types of objects already being
deduplicated might not match the new filter. In practice, this didn't
matter because the CreationInfo comparison function doesn't do anything
that cares if the type is actually a CreationInfo; so it didn't fail
when it was passed something else.

Fix this by creating a separate instance of the deduplication object to
start with a clean state

Signed-off-by: Joshua Watt <[email protected]>
---
 meta/lib/oe/sbom30.py | 1 +
 1 file changed, 1 insertion(+)

diff --git a/meta/lib/oe/sbom30.py b/meta/lib/oe/sbom30.py
index 713eec92d4..e279cfc82b 100644
--- a/meta/lib/oe/sbom30.py
+++ b/meta/lib/oe/sbom30.py
@@ -1236,6 +1236,7 @@ def create_sbom(d, name, root_elements, 
add_objectsets=[]):
             choose=choose_license_expressions,
         )
 
+    with objset.deduplicate() as dedup:
         # Deduplicate creation info
         dedup.find_duplicates(cmp_creation_info, oe.spdx30.CreationInfo)
 
-- 
2.56.0

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#248704): 
https://lists.openembedded.org/g/openembedded-core/message/248704
Mute This Topic: https://lists.openembedded.org/mt/121951028/21656
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to