From 55f2e2035035ac52c096018dbb38103c5301082c Mon Sep 17 00:00:00 2001 From: BELOUARGA Mohamed Date: Sun, 4 Jun 2023 03:39:19 +0200 Subject: bitbake: fetch2/npm: Remove special caracters that causes recipe tool to fail Packages like @(._.)/execute causes problems because they generate names that are not supported by yocto (Bitbake rev: b2e1be67d2acca27451bed59874bc1c2a7ec44a6) Signed-off-by: BELOUARGA Mohamed Signed-off-by: Richard Purdie --- bitbake/lib/bb/fetch2/npm.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/bitbake/lib/bb/fetch2/npm.py b/bitbake/lib/bb/fetch2/npm.py index e6d0598f5d..f83485ad85 100644 --- a/bitbake/lib/bb/fetch2/npm.py +++ b/bitbake/lib/bb/fetch2/npm.py @@ -44,9 +44,12 @@ def npm_package(package): """Convert the npm package name to remove unsupported character""" # Scoped package names (with the @) use the same naming convention # as the 'npm pack' command. - if package.startswith("@"): - return re.sub("/", "-", package[1:]) - return package + name = re.sub("/", "-", package) + name = name.lower() + name = re.sub(r"[^\-a-z0-9]", "", name) + name = name.strip("-") + return name + def npm_filename(package, version): """Get the filename of a npm package""" -- cgit v1.2.3-54-g00ecf