diff mbox series

go-mod-update-modules.bbclass: Fix no licenses

Message ID 20261104115409.3993303-1-christian.lindeberg@axis.com
State Under Review
Headers show
Series go-mod-update-modules.bbclass: Fix no licenses | expand

Commit Message

Christian Lindeberg Nov. 4, 2026, 11:54 a.m. UTC
Fix the no licenses edge case where a trailing "AND" gives a LICENSE
value with an invalid format.
E.g. github.com/jstemmer/go-junit-report@v2.1.0 where only the tests
have external module dependencies.

Signed-off-by: Christian Lindeberg <christian.lindeberg@axis.com>
---
 meta/classes-recipe/go-mod-update-modules.bbclass | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
diff mbox series

Patch

diff --git a/meta/classes-recipe/go-mod-update-modules.bbclass b/meta/classes-recipe/go-mod-update-modules.bbclass
index 435e7e30ff..4c88b92f5d 100644
--- a/meta/classes-recipe/go-mod-update-modules.bbclass
+++ b/meta/classes-recipe/go-mod-update-modules.bbclass
@@ -91,10 +91,10 @@  python do_update_modules() {
         licenses_filename = os.path.join(thisdir, f"{bpn}-licenses.inc")
         with open(licenses_filename, "w") as f:
             f.write(notice)
-            f.write('LICENSE += "AND')
+            f.write('LICENSE += "')
             if licenses:
-                f.write(' ')
-                f.write(oe.spdx_license.AndOp.join(licenses).sort().to_string())
+                f.write(oe.spdx_license.AndOp + ' ' +
+                        oe.spdx_license.AndOp.join(licenses).sort().to_string())
             f.write('"\n\n')
             f.write('LIC_FILES_CHKSUM += "\\\n')
             for lic in sorted(lic_files_chksum, key=fold_uri):