summaryrefslogtreecommitdiffstats
path: root/meta/classes-global/base.bbclass
diff options
context:
space:
mode:
authorRoss Burton <ross.burton@arm.com>2023-05-24 15:57:21 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2023-05-31 16:53:04 +0100
commitfa6135ab327a5c869aba5422d8d4d6106d5acc95 (patch)
treee3ecacc21e9903ea65ac6ecc27a7bc72bf795df6 /meta/classes-global/base.bbclass
parent496d14c3ec567699b8b642dd9e217b25c0188823 (diff)
downloadpoky-fa6135ab327a5c869aba5422d8d4d6106d5acc95.tar.gz
base: add ability to provide further details when using LICENSE_FLAGS
Recipes with proprietary licenses often need to use LICENSE_FLAGS so that the user can opt-in with consent. However, if you don't consent then the error simply tells you the license identifier but not further context. Add a new variable LICENSE_FLAGS_DETAILS, which will be looked in for a flag with the name of the licence. If found then the contents are printed as a source of further details. For example, a recipe with an EULA may set: LICENSE_FLAGS = "FooBar-EULA" LICENSE_FLAGS_DETAILS[FooBar-EULA] = "https://example.com/eula" If Foobar-EULA isn't in LICENSE_FLAGS_ACCEPTED then the error message is more useful: Has a restricted license 'FooBar-EULA' which is not listed in your LICENSE_FLAGS_ACCEPTED. For further details, see https://example.com/eula. (From OE-Core rev: cb5cdcaf3310e889e80861ccfaf46c1bce624ac1) Signed-off-by: Ross Burton <ross.burton@arm.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes-global/base.bbclass')
-rw-r--r--meta/classes-global/base.bbclass12
1 files changed, 6 insertions, 6 deletions
diff --git a/meta/classes-global/base.bbclass b/meta/classes-global/base.bbclass
index b6e339ed9c..976a2ddee4 100644
--- a/meta/classes-global/base.bbclass
+++ b/meta/classes-global/base.bbclass
@@ -516,12 +516,12 @@ python () {
516 check_license_format(d) 516 check_license_format(d)
517 unmatched_license_flags = check_license_flags(d) 517 unmatched_license_flags = check_license_flags(d)
518 if unmatched_license_flags: 518 if unmatched_license_flags:
519 if len(unmatched_license_flags) == 1: 519 for unmatched in unmatched_license_flags:
520 message = "because it has a restricted license '{0}'. Which is not listed in LICENSE_FLAGS_ACCEPTED".format(unmatched_license_flags[0]) 520 message = "Has a restricted license '%s' which is not listed in your LICENSE_FLAGS_ACCEPTED." % unmatched
521 else: 521 details = d.getVarFlag("LICENSE_FLAGS_DETAILS", unmatched)
522 message = "because it has restricted licenses {0}. Which are not listed in LICENSE_FLAGS_ACCEPTED".format( 522 if details:
523 ", ".join("'{0}'".format(f) for f in unmatched_license_flags)) 523 message += " For further details, see %s." % details
524 bb.debug(1, "Skipping %s %s" % (pn, message)) 524 bb.debug(1, "Skipping %s: %s" % (pn, message))
525 raise bb.parse.SkipRecipe(message) 525 raise bb.parse.SkipRecipe(message)
526 526
527 # If we're building a target package we need to use fakeroot (pseudo) 527 # If we're building a target package we need to use fakeroot (pseudo)