From 69bf37a3dd0470dc153bb7a21bd8f13a64bde2c3 Mon Sep 17 00:00:00 2001 From: Enguerrand de Ribaucourt Date: Mon, 12 Aug 2024 14:28:28 +0200 Subject: 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 Signed-off-by: Alexandre Belloni Signed-off-by: Richard Purdie --- scripts/lib/recipetool/create_go.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'scripts/lib/recipetool/create_go.py') diff --git a/scripts/lib/recipetool/create_go.py b/scripts/lib/recipetool/create_go.py index a85a2f2786..5cc53931f0 100644 --- a/scripts/lib/recipetool/create_go.py +++ b/scripts/lib/recipetool/create_go.py @@ -14,7 +14,7 @@ from collections import namedtuple from enum import Enum from html.parser import HTMLParser from recipetool.create import RecipeHandler, handle_license_vars -from recipetool.create import guess_license, tidy_licenses, fixup_license +from recipetool.create import find_licenses, tidy_licenses, fixup_license from recipetool.create import determine_from_url from urllib.error import URLError, HTTPError @@ -624,7 +624,7 @@ class GoRecipeHandler(RecipeHandler): licenses = [] lic_files_chksum = [] - licvalues = guess_license(tmp_vendor_dir, d) + licvalues = find_licenses(tmp_vendor_dir, d) shutil.rmtree(tmp_vendor_dir) if licvalues: -- cgit v1.2.3-54-g00ecf