diff options
Diffstat (limited to 'meta/classes/license.bbclass')
-rw-r--r-- | meta/classes/license.bbclass | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/meta/classes/license.bbclass b/meta/classes/license.bbclass index 4cf7f074fc..0e5675c500 100644 --- a/meta/classes/license.bbclass +++ b/meta/classes/license.bbclass | |||
@@ -316,8 +316,8 @@ def check_license_flags(d): | |||
316 | This function checks if a recipe has any LICENSE_FLAGS that | 316 | This function checks if a recipe has any LICENSE_FLAGS that |
317 | aren't whitelisted. | 317 | aren't whitelisted. |
318 | 318 | ||
319 | If it does, it returns the first LICENSE_FLAGS item missing from the | 319 | If it does, it returns the all LICENSE_FLAGS missing from the whitelist, or |
320 | whitelist, or all of the LICENSE_FLAGS if there is no whitelist. | 320 | all of the LICENSE_FLAGS if there is no whitelist. |
321 | 321 | ||
322 | If everything is is properly whitelisted, it returns None. | 322 | If everything is is properly whitelisted, it returns None. |
323 | """ | 323 | """ |
@@ -354,22 +354,23 @@ def check_license_flags(d): | |||
354 | return False | 354 | return False |
355 | 355 | ||
356 | def all_license_flags_match(license_flags, whitelist): | 356 | def all_license_flags_match(license_flags, whitelist): |
357 | """ Return first unmatched flag, None if all flags match """ | 357 | """ Return all unmatched flags, None if all flags match """ |
358 | pn = d.getVar('PN') | 358 | pn = d.getVar('PN') |
359 | split_whitelist = whitelist.split() | 359 | split_whitelist = whitelist.split() |
360 | flags = [] | ||
360 | for flag in license_flags.split(): | 361 | for flag in license_flags.split(): |
361 | if not license_flag_matches(flag, split_whitelist, pn): | 362 | if not license_flag_matches(flag, split_whitelist, pn): |
362 | return flag | 363 | flags.append(flag) |
363 | return None | 364 | return flags if flags else None |
364 | 365 | ||
365 | license_flags = d.getVar('LICENSE_FLAGS') | 366 | license_flags = d.getVar('LICENSE_FLAGS') |
366 | if license_flags: | 367 | if license_flags: |
367 | whitelist = d.getVar('LICENSE_FLAGS_WHITELIST') | 368 | whitelist = d.getVar('LICENSE_FLAGS_WHITELIST') |
368 | if not whitelist: | 369 | if not whitelist: |
369 | return license_flags | 370 | return license_flags.split() |
370 | unmatched_flag = all_license_flags_match(license_flags, whitelist) | 371 | unmatched_flags = all_license_flags_match(license_flags, whitelist) |
371 | if unmatched_flag: | 372 | if unmatched_flags: |
372 | return unmatched_flag | 373 | return unmatched_flags |
373 | return None | 374 | return None |
374 | 375 | ||
375 | def check_license_format(d): | 376 | def check_license_format(d): |