summaryrefslogtreecommitdiffstats
path: root/scripts/lib/recipetool/create_npm.py
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 /scripts/lib/recipetool/create_npm.py
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 'scripts/lib/recipetool/create_npm.py')
-rw-r--r--scripts/lib/recipetool/create_npm.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/scripts/lib/recipetool/create_npm.py b/scripts/lib/recipetool/create_npm.py
index dd0ac01c3e..78dc248f31 100644
--- a/scripts/lib/recipetool/create_npm.py
+++ b/scripts/lib/recipetool/create_npm.py
@@ -17,7 +17,7 @@ from bb.fetch2.npm import npm_package
17from bb.fetch2.npmsw import foreach_dependencies 17from bb.fetch2.npmsw import foreach_dependencies
18from recipetool.create import RecipeHandler 18from recipetool.create import RecipeHandler
19from recipetool.create import get_license_md5sums 19from recipetool.create import get_license_md5sums
20from recipetool.create import guess_license 20from recipetool.create import find_licenses
21from recipetool.create import split_pkg_licenses 21from recipetool.create import split_pkg_licenses
22logger = logging.getLogger('recipetool') 22logger = logging.getLogger('recipetool')
23 23
@@ -320,7 +320,7 @@ class NpmRecipeHandler(RecipeHandler):
320 return (licenses, chksums, fallback_licenses) 320 return (licenses, chksums, fallback_licenses)
321 321
322 (licenses, extravalues["LIC_FILES_CHKSUM"], fallback_licenses) = _guess_odd_license(licfiles) 322 (licenses, extravalues["LIC_FILES_CHKSUM"], fallback_licenses) = _guess_odd_license(licfiles)
323 split_pkg_licenses([*licenses, *guess_license(srctree, d)], packages, lines_after, fallback_licenses) 323 split_pkg_licenses([*licenses, *find_licenses(srctree, d)], packages, lines_after, fallback_licenses)
324 324
325 classes.append("npm") 325 classes.append("npm")
326 handled.append("buildsystem") 326 handled.append("buildsystem")