poky/scripts/lib/recipetool
Enguerrand de Ribaucourt 0a0caacfa5 recipetool: create_npm: reuse license utils
create_npm.py duplicated the logic for matching licenses from files and
also finding them. This patch refactors the code to reuse the license
utils. This will make the code more maintainable and also align both
behaviors. For instance, some licenses weren't matched properly because
the duplicate logic did not support the difference in format in the md5
tables for COMMON_LICENSE_DIR and licenses.csv.

This is also faster since the license files were being read twice.
The result is slightly more accurate since the utils have better
implementations, and I was able to reuse the logic for the root PN
package, as well as the base LICENSE variable.

I chose to extract generate_common_licenses_chksums into create.py
since it can be considered a general utility function to allow
other recipetool creators to refer to COMMON_LICENSE_DIR files.

I updated the wording in the code when appropriate.

v3:
 - added commit
 - this replaces the commit that added all the COMMON_LICENSE_DIR md5
   to licenses.csv

(From OE-Core rev: 7bc18bed63b94689890bcde63402d7cc1cedffa9)

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>
2024-08-23 09:51:36 +01:00
..
__init__.py scripts/recipetool: Add a recipe auto-creation script 2014-12-23 10:18:15 +00:00
append.py classes/lib/scripts: Initial WORKDIR -> UNPACKDIR updates 2024-05-02 15:15:51 +01:00
create_buildsys_python.py recipetool; add support for python_mesonpy class 2024-02-20 11:39:45 +00:00
create_buildsys.py scripts: python 3.12 regex 2024-02-13 13:51:41 +00:00
create_go.py recipetool: create: split guess_license function 2024-08-23 09:51:36 +01:00
create_kernel.py meta/lib+scripts: Convert to SPDX license headers 2019-05-09 16:31:55 +01:00
create_kmod.py Convert to new override syntax 2021-08-02 15:44:10 +01:00
create_npm.py recipetool: create_npm: reuse license utils 2024-08-23 09:51:36 +01:00
create.py recipetool: create_npm: reuse license utils 2024-08-23 09:51:36 +01:00
edit.py recipetool: Fix list concatenation when using edit 2020-06-15 14:53:45 +01:00
licenses.csv recipetool/devtool: Further SPDX identifier cleanups 2022-03-02 18:43:24 +00:00
newappend.py meta/lib+scripts: Convert to SPDX license headers 2019-05-09 16:31:55 +01:00
setvar.py recipetool/devtool: Ensure server knows about changed files 2023-09-18 11:35:38 +01:00