archiver.bbclass: Reduce some duplication for function get_licenses
cover archiver.bbclass: Reduce some duplication for function get_licenses
From: Xiaofeng Yan <[email protected]>
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
The following changes since commit df8f55a919b3cc602ce1f1c51630c7edf6e36b55:
Cristian Iorga (1):
ltp: Add patch to correct failing build
are available in the git repository at:
git://git.pokylinux.org/poky-contrib xiaofeng/2473
http://git.pokylinux.org/cgit.cgi/poky-contrib/log/?h=xiaofeng/2473
Xiaofeng Yan (1):
archiver.bbclass: Reduce some duplication for function get_licenses
meta/classes/archiver.bbclass | 23 ++++++++++++----------- 1 files changed, 12 insertions(+), 11 deletions(-)
PATCH 1/1 archiver.bbclass: Reduce some duplication for function get_licenses
From: Xiaofeng Yan <[email protected]>
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]
--- meta/classes/archiver.bbclass | 23 ++++++++++++----------- 1 files changed, 12 insertions(+), 11 deletions(-)
meta/classes/archiver.bbclass +12 -11
@@ -225,17 +225,18 @@ def archive_logs(d,logdir,bbinc=False): def get_licenses(d): '''get licenses for running .bb file''' - licenses = d.getVar('LICENSE', 1).replace('&', '|') - licenses = licenses.replace('(', '').replace(')', '') - clean_licenses = "" - for x in licenses.split(): - if x.strip() == '' or x == 'CLOSED': - continue - if x != "|": - clean_licenses += x - if '|' in clean_licenses: - clean_licenses = clean_licenses.replace('|','') - return clean_licenses + import oe.license + + licenses_type = d.getVar('LICENSE', True) or "" + lics = oe.license.is_included(licenses_type)[1:][0] + lice = '' + for lic in lics: + licens = d.getVarFlag('SPDXLICENSEMAP', lic) + if licens != None: + lice += licens + else: + lice += lic + return lice def move_tarball_deploy(d,tarball_list):
Signature · 1 line
1.7.0.4
Saul Wold
AppliedQuoted 19 lines · On 06/06/2012 07:01 PM, [email protected] wrote:
From: Xiaofeng Yan<[email protected]>
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 licensesThe following changes since commit
df8f55a919b3cc602ce1f1c51630c7edf6e36b55:
Cristian Iorga (1):
ltp: Add patch to correct failing buildare available in the git repository at:
git://git.pokylinux.org/poky-contrib xiaofeng/2473 http://git.pokylinux.org/cgit.cgi/poky-contrib/log/?h=xiaofeng/2473Xiaofeng Yan (1):
archiver.bbclass: Reduce some duplication for functionget_licenses
Quoted 10 lines
meta/classes/archiver.bbclass | 23 ++++++++++++----------- 1 files changed, 12 insertions(+), 11 deletions(-)_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core
Merged into OE-Core
Thanks
Sau!