mirror of
https://git.yoctoproject.org/poky
synced 2026-05-30 12:29:55 +00:00
archiver.bbclass: Reduce some duplication for function get_licenses
The content to modify this bbclass is as follow: - Use the existing functions to get license as a directory instead of rewriting it for avoiding code duplication. - Use SPDXLICENSEMAP to map licenses [YOCTO #2473] (From OE-Core rev: 31bee6e7b0a23efc1555ab739ef10041803d5bb1) Signed-off-by: Xiaofeng Yan <xiaofeng.yan@windriver.com> Signed-off-by: Elizabeth Flanagan <elizabeth.flanagan@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
committed by
Richard Purdie
parent
5be715a6ac
commit
9a519998f4
@@ -225,17 +225,18 @@ def archive_logs(d,logdir,bbinc=False):
|
|||||||
|
|
||||||
def get_licenses(d):
|
def get_licenses(d):
|
||||||
'''get licenses for running .bb file'''
|
'''get licenses for running .bb file'''
|
||||||
licenses = d.getVar('LICENSE', 1).replace('&', '|')
|
import oe.license
|
||||||
licenses = licenses.replace('(', '').replace(')', '')
|
|
||||||
clean_licenses = ""
|
licenses_type = d.getVar('LICENSE', True) or ""
|
||||||
for x in licenses.split():
|
lics = oe.license.is_included(licenses_type)[1:][0]
|
||||||
if x.strip() == '' or x == 'CLOSED':
|
lice = ''
|
||||||
continue
|
for lic in lics:
|
||||||
if x != "|":
|
licens = d.getVarFlag('SPDXLICENSEMAP', lic)
|
||||||
clean_licenses += x
|
if licens != None:
|
||||||
if '|' in clean_licenses:
|
lice += licens
|
||||||
clean_licenses = clean_licenses.replace('|','')
|
else:
|
||||||
return clean_licenses
|
lice += lic
|
||||||
|
return lice
|
||||||
|
|
||||||
|
|
||||||
def move_tarball_deploy(d,tarball_list):
|
def move_tarball_deploy(d,tarball_list):
|
||||||
|
|||||||
Reference in New Issue
Block a user