go-mod-update-modules.bbclass: Fix no licenses
PATCH v2 1/1 go-mod-update-modules.bbclass: Fix no licenses
Fix the no licenses edge case where a trailing "AND" gives a LICENSE value with an invalid format.
E.g. github.com/jstemmer/[email protected] where only the tests have external module dependencies.
Signed-off-by Christian Lindeberg <[email protected]>
--- meta/classes-recipe/go-mod-update-modules.bbclass | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
meta/classes-recipe/go-mod-update-modules.bbclass +3 -3
@@ -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.NAME + ' ' + + 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):