diff options
author | Enguerrand de Ribaucourt <enguerrand.de-ribaucourt@savoirfairelinux.com> | 2024-08-12 14:28:28 +0200 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2024-08-23 09:51:36 +0100 |
commit | 69bf37a3dd0470dc153bb7a21bd8f13a64bde2c3 (patch) | |
tree | cb531ea0bd3590e2f2b29a00156de6078027a5d8 /scripts/lib/recipetool/create_go.py | |
parent | 01d17cd5d42d1c9c349e1249bdacffb24d8446bb (diff) | |
download | poky-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_go.py')
-rw-r--r-- | scripts/lib/recipetool/create_go.py | 4 |
1 files changed, 2 insertions, 2 deletions
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 | |||
14 | from enum import Enum | 14 | from enum import Enum |
15 | from html.parser import HTMLParser | 15 | from html.parser import HTMLParser |
16 | from recipetool.create import RecipeHandler, handle_license_vars | 16 | from recipetool.create import RecipeHandler, handle_license_vars |
17 | from recipetool.create import guess_license, tidy_licenses, fixup_license | 17 | from recipetool.create import find_licenses, tidy_licenses, fixup_license |
18 | from recipetool.create import determine_from_url | 18 | from recipetool.create import determine_from_url |
19 | from urllib.error import URLError, HTTPError | 19 | from urllib.error import URLError, HTTPError |
20 | 20 | ||
@@ -624,7 +624,7 @@ class GoRecipeHandler(RecipeHandler): | |||
624 | 624 | ||
625 | licenses = [] | 625 | licenses = [] |
626 | lic_files_chksum = [] | 626 | lic_files_chksum = [] |
627 | licvalues = guess_license(tmp_vendor_dir, d) | 627 | licvalues = find_licenses(tmp_vendor_dir, d) |
628 | shutil.rmtree(tmp_vendor_dir) | 628 | shutil.rmtree(tmp_vendor_dir) |
629 | 629 | ||
630 | if licvalues: | 630 | if licvalues: |