1
0
mirror of https://git.yoctoproject.org/poky synced 2026-06-13 17:10:01 +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:
Enguerrand de Ribaucourt
2024-08-12 14:28:28 +02:00
committed by Richard Purdie
parent 01d17cd5d4
commit 69bf37a3dd
5 changed files with 31 additions and 20 deletions
+2 -2
View File
@@ -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: