diff mbox series

[3/5] spdx_license: give UnknownId a name

Message ID 20260922092411.262885-3-f_l_k@t-online.de
State New
Headers show
Series [1/5] gcr: initialize libgcrypt from the secret exchange | expand

Commit Message

Markus Volk Sept. 22, 2026, 9:23 a.m. UTC
A LICENSE that contains an unknown identifier, as go-mod-update-modules
writes it for modules whose license it could not classify, made
do_populate_lic fail with an AttributeError in get_license_path instead
of the license-exists QA error. Give UnknownId the same name property
as LicenseId and ExceptionId so the lookup can fail gracefully.

AI-Generated: Uses Claude Code (Claude Fable 5.1)
Signed-off-by: Markus Volk <f_l_k@t-online.de>
---
 meta/lib/oe/spdx_license.py | 4 ++++
 1 file changed, 4 insertions(+)
diff mbox series

Patch

diff --git a/meta/lib/oe/spdx_license.py b/meta/lib/oe/spdx_license.py
index 1e201f21d5..7369eca9ef 100644
--- a/meta/lib/oe/spdx_license.py
+++ b/meta/lib/oe/spdx_license.py
@@ -240,6 +240,10 @@  class Identifier(Node):
 
 
 class UnknownId(Identifier):
+    @property
+    def name(self):
+        return self.ident
+
     @classmethod
     def reduce(cls, stack, lookahead):
         if not check_stack_types(stack, [Token]):