summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNeil Horman <nhorman@gmail.com>2022-08-30 07:44:45 -0400
committerRichard Purdie <richard.purdie@linuxfoundation.org>2022-09-01 10:07:00 +0100
commit9e22a3cccf69a54384767c8d2f22b4badcdab36c (patch)
tree2e4fbb67ac410227c20309f999822745fbbfd83d
parentb5597638c7f25daa14f6c439b5af4fbb02267dd7 (diff)
downloadpoky-9e22a3cccf69a54384767c8d2f22b4badcdab36c.tar.gz
bitbake: Fix npm to use https rather than http
Hit this error while building nlf-native recently: { "error": { "summary": "URI malformed", "detail": "" } } Some poking about led me to discover that: 1) The npm.py tool replaces npm:// with http://, not https:// 2) Some versions of the npm tool don't handle 301 redirects properly, choosing to display the above error instead when using the default nodejs registry It would be good to go fix npm to handle the redirect properly, but it seems like it would also be good to assume secure http when contacting a registry, hence, this patch (Bitbake rev: 2cd76e8aabe4e803c760e60f06cfe1f470714ec7) Signed-off-by: Neil Horman <nhorman@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--bitbake/lib/bb/fetch2/npm.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/bitbake/lib/bb/fetch2/npm.py b/bitbake/lib/bb/fetch2/npm.py
index 8f7c10ac9b..8a179a339a 100644
--- a/bitbake/lib/bb/fetch2/npm.py
+++ b/bitbake/lib/bb/fetch2/npm.py
@@ -156,7 +156,7 @@ class Npm(FetchMethod):
156 raise ParameterError("Invalid 'version' parameter", ud.url) 156 raise ParameterError("Invalid 'version' parameter", ud.url)
157 157
158 # Extract the 'registry' part of the url 158 # Extract the 'registry' part of the url
159 ud.registry = re.sub(r"^npm://", "http://", ud.url.split(";")[0]) 159 ud.registry = re.sub(r"^npm://", "https://", ud.url.split(";")[0])
160 160
161 # Using the 'downloadfilename' parameter as local filename 161 # Using the 'downloadfilename' parameter as local filename
162 # or the npm package name. 162 # or the npm package name.