fetch2: npm: Remove special caracters that casauses recipe tool to fail
PATCH 1/1 fetch2: npm: Remove special caracters that casauses recipe tool to fail
From: BELOUARGA Mohamed <[email protected]>
Packages like @(._.)/execute causes problems because they generate names that are not supported by yocto
Signed-off-by BELOUARGA Mohamed <[email protected]>
--- lib/bb/fetch2/npm.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-)
lib/bb/fetch2/npm.py +6 -3
@@ -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"""
Signature · 1 line
2.25.1