diff options
author | Paul Eggleton <paul.eggleton@linux.intel.com> | 2016-07-25 20:47:18 +1200 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2016-07-26 08:56:32 +0100 |
commit | 3ec9a621d000037a1657c0b18b5bdf3fb405a56c (patch) | |
tree | e8178a53d13bdbb66ee9bbef69506442fbef93fd /scripts/lib | |
parent | 25507bfa82fc3bc46624952f15278b491a85ad7d (diff) | |
download | poky-3ec9a621d000037a1657c0b18b5bdf3fb405a56c.tar.gz |
recipetool: record unknown license files
Add a comment to the recipe listing license files that were found but
not able to be identified, so that the user can find and examine them
by hand fairly easily.
Fixes [YOCTO #9882].
(From OE-Core rev: 4b7d1bf8172533e9ac91a49ade152a05e2ee4146)
Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts/lib')
-rw-r--r-- | scripts/lib/recipetool/create.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/scripts/lib/recipetool/create.py b/scripts/lib/recipetool/create.py index f246028a02..838c23ba9b 100644 --- a/scripts/lib/recipetool/create.py +++ b/scripts/lib/recipetool/create.py | |||
@@ -479,12 +479,15 @@ def create_recipe(args): | |||
479 | 479 | ||
480 | licvalues = guess_license(srctree_use) | 480 | licvalues = guess_license(srctree_use) |
481 | lic_files_chksum = [] | 481 | lic_files_chksum = [] |
482 | lic_unknown = [] | ||
482 | if licvalues: | 483 | if licvalues: |
483 | licenses = [] | 484 | licenses = [] |
484 | for licvalue in licvalues: | 485 | for licvalue in licvalues: |
485 | if not licvalue[0] in licenses: | 486 | if not licvalue[0] in licenses: |
486 | licenses.append(licvalue[0]) | 487 | licenses.append(licvalue[0]) |
487 | lic_files_chksum.append('file://%s;md5=%s' % (licvalue[1], licvalue[2])) | 488 | lic_files_chksum.append('file://%s;md5=%s' % (licvalue[1], licvalue[2])) |
489 | if licvalue[0] == 'Unknown': | ||
490 | lic_unknown.append(licvalue[1]) | ||
488 | lines_before.append('# WARNING: the following LICENSE and LIC_FILES_CHKSUM values are best guesses - it is') | 491 | lines_before.append('# WARNING: the following LICENSE and LIC_FILES_CHKSUM values are best guesses - it is') |
489 | lines_before.append('# your responsibility to verify that the values are complete and correct.') | 492 | lines_before.append('# your responsibility to verify that the values are complete and correct.') |
490 | if len(licvalues) > 1: | 493 | if len(licvalues) > 1: |
@@ -493,6 +496,13 @@ def create_recipe(args): | |||
493 | lines_before.append('# these in the LICENSE value using & if the multiple licenses all apply, or | if there') | 496 | lines_before.append('# these in the LICENSE value using & if the multiple licenses all apply, or | if there') |
494 | lines_before.append('# is a choice between the multiple licenses. If in doubt, check the accompanying') | 497 | lines_before.append('# is a choice between the multiple licenses. If in doubt, check the accompanying') |
495 | lines_before.append('# documentation to determine which situation is applicable.') | 498 | lines_before.append('# documentation to determine which situation is applicable.') |
499 | if lic_unknown: | ||
500 | lines_before.append('#') | ||
501 | lines_before.append('# The following license files were not able to be identified and are') | ||
502 | lines_before.append('# represented as "Unknown" below, you will need to check them yourself:') | ||
503 | for licfile in lic_unknown: | ||
504 | lines_before.append('# %s' % licfile) | ||
505 | lines_before.append('#') | ||
496 | else: | 506 | else: |
497 | lines_before.append('# Unable to find any files that looked like license statements. Check the accompanying') | 507 | lines_before.append('# Unable to find any files that looked like license statements. Check the accompanying') |
498 | lines_before.append('# documentation and source headers and set LICENSE and LIC_FILES_CHKSUM accordingly.') | 508 | lines_before.append('# documentation and source headers and set LICENSE and LIC_FILES_CHKSUM accordingly.') |