From b71cd1ec45e247db688b784697829c1b485ca9ca Mon Sep 17 00:00:00 2001 From: Nathan Rossi Date: Wed, 7 Nov 2018 08:51:56 +0000 Subject: base.bbclass: Display name of licenses which caused SkipRecipe Display the name of the restricted licenses which caused the recipe to be skipped. This makes it easy to determine which license or licenses are missing and need to be checked and whitelisted. Signed-off-by: Nathan Rossi Signed-off-by: Richard Purdie --- meta/classes/base.bbclass | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'meta/classes/base.bbclass') diff --git a/meta/classes/base.bbclass b/meta/classes/base.bbclass index bc9b236b84..e715ffa1b2 100644 --- a/meta/classes/base.bbclass +++ b/meta/classes/base.bbclass @@ -467,12 +467,15 @@ python () { if bb.data.inherits_class('license', d): check_license_format(d) - unmatched_license_flag = check_license_flags(d) - if unmatched_license_flag: - bb.debug(1, "Skipping %s because it has a restricted license not" - " whitelisted in LICENSE_FLAGS_WHITELIST" % pn) - raise bb.parse.SkipRecipe("because it has a restricted license not" - " whitelisted in LICENSE_FLAGS_WHITELIST") + unmatched_license_flags = check_license_flags(d) + if unmatched_license_flags: + if len(unmatched_license_flags) == 1: + message = "because it has a restricted license '{0}'. Which is not whitelisted in LICENSE_FLAGS_WHITELIST".format(unmatched_license_flags[0]) + else: + message = "because it has restricted licenses {0}. Which are not whitelisted in LICENSE_FLAGS_WHITELIST".format( + ", ".join("'{0}'".format(f) for f in unmatched_license_flags)) + bb.debug(1, "Skipping %s %s" % (pn, message)) + raise bb.parse.SkipRecipe(message) # If we're building a target package we need to use fakeroot (pseudo) # in order to capture permissions, owners, groups and special files -- cgit 1.2.3-korg