summaryrefslogtreecommitdiffstats
path: root/meta/classes-global
diff options
context:
space:
mode:
authorEnguerrand de Ribaucourt <enguerrand.de-ribaucourt@savoirfairelinux.com>2024-08-12 14:28:28 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2024-08-23 09:51:36 +0100
commit69bf37a3dd0470dc153bb7a21bd8f13a64bde2c3 (patch)
treecb531ea0bd3590e2f2b29a00156de6078027a5d8 /meta/classes-global
parent01d17cd5d42d1c9c349e1249bdacffb24d8446bb (diff)
downloadpoky-69bf37a3dd0470dc153bb7a21bd8f13a64bde2c3.tar.gz
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>
Diffstat (limited to 'meta/classes-global')
-rw-r--r--meta/classes-global/license.bbclass8
1 files changed, 4 insertions, 4 deletions
diff --git a/meta/classes-global/license.bbclass b/meta/classes-global/license.bbclass
index b2e0d3faba..4e39ec1d44 100644
--- a/meta/classes-global/license.bbclass
+++ b/meta/classes-global/license.bbclass
@@ -39,7 +39,7 @@ python do_populate_lic() {
39} 39}
40 40
41PSEUDO_IGNORE_PATHS .= ",${@','.join(((d.getVar('COMMON_LICENSE_DIR') or '') + ' ' + (d.getVar('LICENSE_PATH') or '') + ' ' + d.getVar('COREBASE') + '/meta/COPYING').split())}" 41PSEUDO_IGNORE_PATHS .= ",${@','.join(((d.getVar('COMMON_LICENSE_DIR') or '') + ' ' + (d.getVar('LICENSE_PATH') or '') + ' ' + d.getVar('COREBASE') + '/meta/COPYING').split())}"
42# it would be better to copy them in do_install:append, but find_license_filesa is python 42# it would be better to copy them in do_install:append, but find_license_files is python
43python perform_packagecopy:prepend () { 43python perform_packagecopy:prepend () {
44 enabled = oe.data.typed_value('LICENSE_CREATE_PACKAGE', d) 44 enabled = oe.data.typed_value('LICENSE_CREATE_PACKAGE', d)
45 if d.getVar('CLASSOVERRIDE') == 'class-target' and enabled: 45 if d.getVar('CLASSOVERRIDE') == 'class-target' and enabled:
@@ -149,14 +149,14 @@ def find_license_files(d):
149 # and "with exceptions" being * 149 # and "with exceptions" being *
150 # we'll just strip out the modifier and put 150 # we'll just strip out the modifier and put
151 # the base license. 151 # the base license.
152 find_license(node.s.replace("+", "").replace("*", "")) 152 find_licenses(node.s.replace("+", "").replace("*", ""))
153 self.generic_visit(node) 153 self.generic_visit(node)
154 154
155 def visit_Constant(self, node): 155 def visit_Constant(self, node):
156 find_license(node.value.replace("+", "").replace("*", "")) 156 find_licenses(node.value.replace("+", "").replace("*", ""))
157 self.generic_visit(node) 157 self.generic_visit(node)
158 158
159 def find_license(license_type): 159 def find_licenses(license_type):
160 try: 160 try:
161 bb.utils.mkdirhier(gen_lic_dest) 161 bb.utils.mkdirhier(gen_lic_dest)
162 except: 162 except: