diff options
author | Xiaofeng Yan <xiaofeng.yan@windriver.com> | 2012-06-07 16:37:07 -0700 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2012-06-08 11:43:22 +0100 |
commit | 9a519998f4e64dc067882c9fcd4416db49fccccd (patch) | |
tree | 5ca48f41ecaaf59d0f7e0de3e1f4168e582c44d7 /meta/classes | |
parent | 5be715a6acd85cef3304dcb2945c5b575326ccb8 (diff) | |
download | poky-9a519998f4e64dc067882c9fcd4416db49fccccd.tar.gz |
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>
Diffstat (limited to 'meta/classes')
-rw-r--r-- | meta/classes/archiver.bbclass | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/meta/classes/archiver.bbclass b/meta/classes/archiver.bbclass index ed2dbe4ed8..083bb1dfa5 100644 --- a/meta/classes/archiver.bbclass +++ b/meta/classes/archiver.bbclass | |||
@@ -225,17 +225,18 @@ def archive_logs(d,logdir,bbinc=False): | |||
225 | 225 | ||
226 | def get_licenses(d): | 226 | def get_licenses(d): |
227 | '''get licenses for running .bb file''' | 227 | '''get licenses for running .bb file''' |
228 | licenses = d.getVar('LICENSE', 1).replace('&', '|') | 228 | import oe.license |
229 | licenses = licenses.replace('(', '').replace(')', '') | 229 | |
230 | clean_licenses = "" | 230 | licenses_type = d.getVar('LICENSE', True) or "" |
231 | for x in licenses.split(): | 231 | lics = oe.license.is_included(licenses_type)[1:][0] |
232 | if x.strip() == '' or x == 'CLOSED': | 232 | lice = '' |
233 | continue | 233 | for lic in lics: |
234 | if x != "|": | 234 | licens = d.getVarFlag('SPDXLICENSEMAP', lic) |
235 | clean_licenses += x | 235 | if licens != None: |
236 | if '|' in clean_licenses: | 236 | lice += licens |
237 | clean_licenses = clean_licenses.replace('|','') | 237 | else: |
238 | return clean_licenses | 238 | lice += lic |
239 | return lice | ||
239 | 240 | ||
240 | 241 | ||
241 | def move_tarball_deploy(d,tarball_list): | 242 | def move_tarball_deploy(d,tarball_list): |