]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commit
recipetool: create_npm: resolve licenses defined in package.json
authorEnguerrand de Ribaucourt <enguerrand.de-ribaucourt@savoirfairelinux.com>
Mon, 12 Aug 2024 12:28:27 +0000 (14:28 +0200)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Fri, 23 Aug 2024 08:49:13 +0000 (09:49 +0100)
commit445604cfc4a5813ea635f18053cd1f673bf0b830
treeb2edf8fb7da4fdf6d97e0bc29371861881b57b5f
parent470c4c027c2b8bbecf23aa63650a22a312de9aa6
recipetool: create_npm: resolve licenses defined in package.json

Some npm packages do not copy the LICENSE or COPY file into their
git repository. They'll instead simply use SPDX identifiers in their
package.json. A fallback for those repositories attempted to match
the README file to a license file instead, which had a very low
probability of success.

This commit replaces this fallback with parsing the package.json and
looking for the license in COMMON_LICENSE_DIR. If the license is not
found, "Unknown" will still be produced.

This also generates "Unknown" for packages which had no README file,
which could silently not appear in the generated recipe. The user was
more likely to miss them.

Co-authored-by: Tanguy Raufflet <tanguy.raufflet@savoirfairelinux.com>
Signed-off-by: Tanguy Raufflet <tanguy.raufflet@savoirfairelinux.com>
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>
scripts/lib/recipetool/create_npm.py