mirror of
https://git.yoctoproject.org/poky
synced 2026-05-09 05:29:32 +00:00
recipetool: create: split guess_license function
The npm recipetool handler redefines the license code the could be unified. In order to do this refactoring, extract the bits we'll need into separate functions. guess_license() is renamed to find_licenses() and is split into find_license_files() and match_licenses(). (From OE-Core rev: f1ec28feaea8ea6a2df894dd4ddba561c8a04ed2) Signed-off-by: Enguerrand de Ribaucourt <enguerrand.de-ribaucourt@savoirfairelinux.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
committed by
Richard Purdie
parent
01d17cd5d4
commit
69bf37a3dd
@@ -39,7 +39,7 @@ python do_populate_lic() {
|
||||
}
|
||||
|
||||
PSEUDO_IGNORE_PATHS .= ",${@','.join(((d.getVar('COMMON_LICENSE_DIR') or '') + ' ' + (d.getVar('LICENSE_PATH') or '') + ' ' + d.getVar('COREBASE') + '/meta/COPYING').split())}"
|
||||
# it would be better to copy them in do_install:append, but find_license_filesa is python
|
||||
# it would be better to copy them in do_install:append, but find_license_files is python
|
||||
python perform_packagecopy:prepend () {
|
||||
enabled = oe.data.typed_value('LICENSE_CREATE_PACKAGE', d)
|
||||
if d.getVar('CLASSOVERRIDE') == 'class-target' and enabled:
|
||||
@@ -149,14 +149,14 @@ def find_license_files(d):
|
||||
# and "with exceptions" being *
|
||||
# we'll just strip out the modifier and put
|
||||
# the base license.
|
||||
find_license(node.s.replace("+", "").replace("*", ""))
|
||||
find_licenses(node.s.replace("+", "").replace("*", ""))
|
||||
self.generic_visit(node)
|
||||
|
||||
def visit_Constant(self, node):
|
||||
find_license(node.value.replace("+", "").replace("*", ""))
|
||||
find_licenses(node.value.replace("+", "").replace("*", ""))
|
||||
self.generic_visit(node)
|
||||
|
||||
def find_license(license_type):
|
||||
def find_licenses(license_type):
|
||||
try:
|
||||
bb.utils.mkdirhier(gen_lic_dest)
|
||||
except:
|
||||
|
||||
Reference in New Issue
Block a user